Repository navigation
feat(agent-prompt): add claude desktop, vs code and web destinations - #112270
Conversation
|
😎 This pull request was merged. |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes.
|
| Function | Location | Complexity | Limit |
|---|---|---|---|
AgentPromptButton |
frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx:265 |
16 | 10 |
✅ Duplication (Python) — clean
New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
✅ Duplication (TypeScript) — clean
New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
⚠️ Comment density — 4% of added code lines are comments (9 of 210)
This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.
Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.
Files with the most added comment lines:
| File | Comment lines | Added lines |
|---|---|---|
frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx |
9 | 96 |
This check does not block merging. It updates on every push and clears when the share drops.
⚠️ Bundle size — 🔺 +431 B (+0.0%)
Uncompressed size of every built .js bundle, compared against the base branch.
Total: 76.00 MiB · 🔺 +431 B (+0.0%)
No file changed by more than 1000 B.
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
⚠️ Eager graph — 2 over budget
How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.64 MiB · 23 files | no change | █████████░ 88.9% of 1.84 MiB |
logged-out boot: index + App + bootApp (preloaded by every page, including /login)src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts |
3.72 MiB · 663 files | no change | █████████░ 92.3% of 4.03 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
7.62 MiB · 2,415 files | no change | █████████░ 91.4% of 8.34 MiB |
🟡 dashboard scenesrc/scenes/dashboard/Dashboard.tsx |
13.90 MiB · 4,917 files | 🔺 +207 B (+0.0%) | ██████████ 103.2% of 13.48 MiB |
today home pathsrc/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx |
7.64 MiB · 2,427 files | no change | █████████░ 89.0% of 8.58 MiB |
🟡 events scenesrc/scenes/activity/explore/EventsScene.tsx |
13.63 MiB · 4,789 files | 🔺 +207 B (+0.0%) | ██████████ 107.9% of 12.64 MiB |
replay detail scenesrc/scenes/session-recordings/detail/SessionRecordingDetail.tsx |
12.13 MiB · 4,142 files | 🔺 +207 B (+0.0%) | ████████░░ 77.2% of 15.72 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/layout/navigation-3000/navigationLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/dashboard/dashboardLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/lemon-ui/LemonMarkdown/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/RichContentEditor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/CodeSnippet/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/taxonomy/core-filter-definitions-by-group.json stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 products/dashboards/frontend/widgets/previews/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 zod/v4/locales/de.js stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/scenes/project-homepage/today/TodayReportPage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/queries/Query/Query.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/index.tsx |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 839 B | src/scenes/ChunkLoadErrorBoundary.tsx |
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
| Size | File |
|---|---|
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 99.7 KiB | src/lib/api.ts |
| 90.6 KiB | src/products.tsx |
| 68.7 KiB | src/lib/lemon-ui/icons/icons.tsx |
| 40.7 KiB | src/lib/utils/eventUsageLogic.ts |
| 38.7 KiB | ../node_modules/.pnpm/@dnd-kit+core@6.0.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js |
| 33.9 KiB | ../node_modules/.pnpm/kea@4.0.0-pre.6_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js |
| 29.0 KiB | ../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 280.3 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 112.3 KiB | ../packages/quill/packages/quill/dist/index.js |
| 99.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
| 90.6 KiB | src/products.tsx |
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 280.3 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 112.3 KiB | ../packages/quill/packages/quill/dist/index.js |
| 99.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
| Size | File |
|---|---|
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 280.3 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 112.3 KiB | ../packages/quill/packages/quill/dist/index.js |
| 99.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
| 90.6 KiB | src/products.tsx |
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 280.3 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 112.3 KiB | ../packages/quill/packages/quill/dist/index.js |
| 99.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 280.3 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 220.3 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 112.3 KiB | ../packages/quill/packages/quill/dist/index.js |
| 99.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Toolbar bundle — eager 2.21 MiB within budget
What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.
| Metric | Size | Δ vs base | Budget |
|---|---|---|---|
| Eager (shipped) entry + static imports |
2.21 MiB · 19 files | no change | ████░░░░░░ 38.7% of 5.72 MiB |
| Deferred (lazy) | 2.12 MiB · 44 files | no change | n/a — loads on demand |
Loader dist/toolbar.js |
1.2 KiB | no change | █░░░░░░░░░ 6.0% of 19.5 KiB |
Largest eagerly-shipped chunks
| Size | File |
|---|---|
| 850.6 KiB | dist/toolbar/toolbar-app-5BH4NJL4.css |
| 657.4 KiB | dist/toolbar/chunk-chunk-R75Z5TYV.js |
| 259.4 KiB | dist/toolbar/chunk-chunk-6EL3FW4B.js |
| 138.2 KiB | dist/toolbar/chunk-chunk-2GNJAOKU.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-FDH2IBXT.js |
| 75.2 KiB | dist/toolbar/toolbar-app-2PA223GW.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-TSAL54PB.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-46UEXYQR.js |
| 21.0 KiB | dist/toolbar/chunk-chunk-Q5QJDMUL.js |
| 6.8 KiB | dist/toolbar/chunk-chunk-DV7IWQNF.js |
Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile
✅ Dist folder size — 🔺 +16.2 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 998.63 MiB · 🔺 +16.2 KiB (+0.0%)
✅ Hogbox preview — ready, open the preview
▶ Open the preview
| 🔑 Login | test@posthog.com / 12345678 (demo data) |
| 🧩 Running | this PR's backend and frontend, on the PostHog :master base |
| 🔗 Link | stable across rebuilds: a re-push swaps the box underneath, the URL stays |
| 🔒 Access | tailnet only (PostHog VPN) |
| 🛠️ Admin | inspect & debug state in hogland |
| 💤 Idle | sleeps after ~30 min idle (snapshot to S3, zero node cost) and wakes on your next visit in ~30s, behind a brief "waking up" screen |
commit 00811bf · box box-81a0f9ce5af8 · ready in 680s (push → usable) · build log · rebuilds on every push, torn down on close
|
[Medium risk] Adds new agent destinations to the code assistance UI. The PR’s behavior appears safe to merge, but the repository’s absent-result requirement should be satisfied first. Reviews (2) · Last reviewed commit: "fix(signals): open inbox agent links wit..." |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds GitHub repository slug extraction and uses validated slugs as prompt context. Agent prompt links now support additional Claude destinations and Codex repository context. Prompt truncation uses agent-specific limits and URL-length caps. The agent menus expose the new destinations, and tests cover generated links, length limits, and emoji handling. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to People using URL-form GitHub SSH remotes may open an agent prompt without repository context. The affected workflow is limited, but this context loss remains an open concern. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new destinations can receive error details and repository context, but opening them still requires user action. Destination addresses are fixed, supplied values are encoded, and the change does not itself grant credentials or execution permissions. How the receiving applications handle this information remains outside the reviewed code. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
frontend/src/lib/components/Git/gitMetadataParser.ts-51-53 (1)
51-53: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHandle URL-form SSH remotes before rejecting the GitHub slug.
For
ssh://git@github.com/PostHog/posthog.git, the SSH parser treats the scheme colon as its scp-style separator. The newly added helper then returnsundefined. Parse URL-form SSH remotes separately and add a regression case for this input.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
9b7e2192-dfe3-4dc8-bbed-71d5571d7a39
📒 Files selected for processing (7)
frontend/src/lib/components/AgentPromptButton/AgentPromptButton.test.tsfrontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsxfrontend/src/lib/components/AgentPromptButton/index.tsfrontend/src/lib/components/Git/gitMetadataParser.spec.tsfrontend/src/lib/components/Git/gitMetadataParser.tsproducts/error_tracking/frontend/components/ExceptionCard/Tabs/StackTraceTab/StackTraceActions.tsxproducts/signals/frontend/inbox/components/detail/ImplementButton.tsx
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
| buildClaudeCodeVSCodeDeepLink, | ||
| buildClaudeCodeWebLink, | ||
| buildClaudeDesktopDeepLink, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,65p' frontend/src/lib/components/AgentPromptButton/index.ts
rg -n 'buildClaudeCodeVSCodeDeepLink|buildClaudeCodeWebLink|buildClaudeDesktopDeepLink' frontend/src/lib/components/AgentPromptButton products/signals/frontend/inbox/components/detail/ImplementButton.tsxRepository: PostHog/posthog
Length of output: 3068
🏁 Script executed:
set -eu
printf '%s\n' '--- focused diff ---'
git diff --no-ext-diff --unified=8 5d280e7503147d30fd75a706ae64d87b7f1e6edd 1b2e2d11ae4a68a9419bafd5e197d4ac8ddb2676 -- frontend/src/lib/components/AgentPromptButton/index.ts frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx products/signals/frontend/inbox/components/detail/ImplementButton.tsx
printf '%s\n' '--- index ---'
nl -ba frontend/src/lib/components/AgentPromptButton/index.ts
printf '%s\n' '--- builder declarations and exports ---'
nl -ba frontend/src/lib/components/AgentPromptButton/AgentPromptButton.tsx | sed -n '150,180p'
printf '%s\n' '--- consumer imports ---'
nl -ba products/signals/frontend/inbox/components/detail/ImplementButton.tsx | sed -n '1,22p'
printf '%s\n' '--- guidance candidates ---'
rg --files -g 'AGENTS.md' -g '*writing-ui-components*' -g 'SKILL.md' frontend .claude .agents 2>/dev/null | rg '(^|/)(AGENTS\.md|[^/]*writing-ui-components[^/]*|[^/]+/SKILL\.md)$' | rg 'frontend/src|writing-ui-components' || test "$?" -eq 1
printf '%s\n' '--- relevant guidance text ---'
rg -n -F -e 'Every symbol has exactly one home' -e 'multi-PR migration' -e 'No re-export shims' -e 'Avoid re-export shims' frontend .claude .agents 2>/dev/null || test "$?" -eq 1Repository: PostHog/posthog
Length of output: 19813
Keep one import path for the new builders.
The builders are already exported from AgentPromptButton.tsx. Re-exporting them from the index gives them a second import path. Remove the index re-exports and import the builders directly at the call site.
Suggested fix
diff --git a/frontend/src/lib/components/AgentPromptButton/index.ts b/frontend/src/lib/components/AgentPromptButton/index.ts
@@
- buildClaudeCodeVSCodeDeepLink,
- buildClaudeCodeWebLink,
- buildClaudeDesktopDeepLink,
diff --git a/products/signals/frontend/inbox/components/detail/ImplementButton.tsx b/products/signals/frontend/inbox/components/detail/ImplementButton.tsx
@@
- buildClaudeCodeVSCodeDeepLink,
- buildClaudeCodeWebLink,
- buildClaudeDesktopDeepLink,
@@
} from 'lib/components/AgentPromptButton'
+import {
+ buildClaudeCodeVSCodeDeepLink,
+ buildClaudeCodeWebLink,
+ buildClaudeDesktopDeepLink,
+} from 'lib/components/AgentPromptButton/AgentPromptButton'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| buildClaudeCodeVSCodeDeepLink, | |
| buildClaudeCodeWebLink, | |
| buildClaudeDesktopDeepLink, |
HostHog preview —
|
|
✅ Visual changes approved by @rafaeelaudibert — baseline updated in 2 changed. Changed
Install the Visual Review Chrome extension to see visual review results at the top of your pull requests. |
|
|
Risk: No findings This PR adds Claude Desktop, Claude Code in VS Code, and Claude Code on the web as agent-prompt destinations, switches the stack trace button to a validated GitHub slug derived from the release's remote URL, and caps URL length for Cursor and claude.ai links. All dynamic link parameters are encodeURIComponent'd into fixed-scheme URLs, and the new slug parser only accepts an exact github.com host plus a strict slug pattern, so I found no injection, redirect, or cross-tenant exposure introduced by this change. Sentinel reviewed |
| static getGitHubRepositorySlug(remote_url?: string): string | undefined { | ||
| if (!remote_url) { | ||
| return undefined |
There was a problem hiding this comment.
getGitHubRepositorySlug returns undefined when the remote is missing, is not GitHub, or has an invalid slug. The repository requires null for an intentionally absent function result. Return null consistently and adapt the optional repository prop at the call site. This requirement must be satisfied before merging.
Rule Used: Use 'null' instead of 'undefined' to indicate an intended lack of result in functions. (source)
Learned From
PostHog/posthog#32556
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/lib/components/Git/gitMetadataParser.ts
Line: 47-49
Comment:
**Absent results use undefined**
`getGitHubRepositorySlug` returns `undefined` when the remote is missing, is not GitHub, or has an invalid slug. The repository requires `null` for an intentionally absent function result. Return `null` consistently and adapt the optional `repository` prop at the call site. This requirement must be satisfied before merging.
**Rule Used:** Use 'null' instead of 'undefined' to indicate an intended lack of result in functions. ([source](https://app.greptile.com/posthog-org-19734/-/custom-context?memory=0631667e-2260-42be-a589-0d8da9ef007d))
**Learned From**
[PostHog/posthog#32556](https://github.com/PostHog/posthog/pull/32556)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Add Claude Desktop, Claude Code in VS Code and Claude Code on the web to the agent prompt menus. Pass the repository to Codex as originUrl. Cap Cursor and claude.ai links by total URL length, and keep truncation from splitting a surrogate pair, which made encodeURIComponent throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
posthog-cli records repo_name as the bare repository name, so the stack trace agent button sent values like "posthog" where every agent expects owner/repo. Claude Code then opened in the home directory, and Codex got a wrong originUrl. Derive the slug from the release remote URL instead, and only for GitHub remotes, since every agent repo parameter assumes GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 updated Run: 6cb312db-6dce-403e-a472-4d928c594a89
The inbox agent menu passed `undefined` as the third window.open argument for every destination except claude.ai. Give each destination its own open function instead, so only the claude.ai link passes noopener. Update the test for the "Claude Code CLI" label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f951599 to
00811bf
Compare
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Approved.
Frontend-only change that adds agent deep-link destinations and a stricter GitHub slug parser, and it stays outside risky territory. Tests cover the new link builders and the parser. The open reviewer comments are a style preference (null vs undefined) and an edge case that fails safe (an unparsed remote sends no repo).
- Author wrote 0% of the modified lines and has 28 merged PRs in these paths (familiarity MODERATE).
- 👍 on the PR from greptile-apps[bot].
- Greptile's style point: getGitHubRepositorySlug returns undefined where the repo convention prefers null. Not blocking.
- CodeRabbit's edge case: ssh://-style GitHub remotes return no slug, so no repo is passed. This fails safe.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 199L, 6F substantive, 275L/9F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (275L, 9F, two-areas, feat) |
| stamphog 2.3.1 | .stamphog/policy.yml @ 00811bf · reviewed head 00811bf |
|
Stacked PR 112278 failed testing in the merge queue. Please investigate the failure and re-submit the stack. |
|
This pull request was merged into |
Problem
posthog-clistoresrepo_nameas the bare name (posthog), and every agent expectsowner/repo.Changes
claude://code/new?q=…vscode://anthropic.claude-code/open?prompt=…https://claude.ai/code?prompt=…&repositories=owner/repoclaude-codekey stays, so remembered choices and theagentanalytics property carry over.originUrl=https://github.com/owner/repo, and Codex compares host, owner and repo, so SSH clones match too.URIError, which made the button do nothing.openfunction. Only the claude.ai link passesnoopener, and the other links keep their two-argumentwindow.opencall.w-56never applied.Link formats come from the vendor docs: Claude Code deep links, Claude Desktop, VS Code extension, Claude Code on the web, Codex, Cursor.
How did you test this code?
AgentPromptButton.test.tsandgitMetadataParser.spec.ts. Frontend typecheck passes locally.AgentPromptButtonStorybook story, before on master and after on this branch.Test rationale:
URIErrorat the truncation boundary.getGitHubRepositorySlugcases extend the existing parser spec. They catch a bare name, a GitLab remote, or a remote with a credential reaching an agent link.Release status
Docs update
None. No doc under
docs/covers these menus.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5
/writing-ui-components,/writing-user-facing-copy,/writing-tests,/writing-code-comments,/stacking-prs,/writing-pr-descriptions.originUrlfrom the barerepo_name. Reading the Codex app bundle showed it parses both URLs before matching, so a canonical GitHub URL from a correct slug is enough.agentDeepLinks.ts). Whichever lands later needs a rebase.🤖 Generated with Claude Code