Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 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 |
|---|---|---|---|
submitNewTask |
products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts:706 |
56 | 10 |
sendNow |
products/posthog_ai/frontend/logics/runInteractionLogic.ts:1298 |
44 | 10 |
ComposerModelEffortPickers |
products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx:127 |
22 | 10 |
startNewRun |
products/posthog_ai/frontend/logics/runInteractionLogic.ts:1504 |
21 | 10 |
TaskRunComposer |
products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx:34 |
20 | 10 |
submit |
products/posthog_ai/frontend/logics/runInteractionLogic.ts:911 |
13 | 10 |
TaskRunChat |
products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx:47 |
13 | 10 |
<anonymous> |
products/posthog_ai/frontend/logics/runInteractionLogic.ts:1076 |
12 | 10 |
TaskComposer |
products/posthog_ai/frontend/scenes/TaskTracker/components/TaskComposer.tsx:48 |
11 | 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 — 3% of added code lines are comments (46 of 1389)
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 |
|---|---|---|
products/posthog_ai/frontend/logics/codexBillingLogic.ts |
19 | 174 |
frontend/src/scenes/settings/user/personalCodexIntegrationLogic.ts |
5 | 287 |
products/posthog_ai/frontend/components/composer/ComposerCodexBillingPickers.tsx |
5 | 42 |
products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts |
5 | 40 |
products/posthog_ai/frontend/scenes/TaskTracker/components/TaskComposer.tsx |
4 | 37 |
products/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsx |
3 | 60 |
products/posthog_ai/frontend/logics/runInteractionLogic.ts |
2 | 11 |
products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx |
2 | 34 |
This check does not block merging. It updates on every push and clears when the share drops.
⚠️ Bundle size — 🔺 +12.6 KiB (+0.0%)
Uncompressed size of every built .js bundle, compared against the base branch.
Total: 69.23 MiB · 🔺 +12.6 KiB (+0.0%)
| File | Size | Δ vs base |
|---|---|---|
render-query/src/render-query/render-query.js |
20.20 MiB | 🔺 +7.1 KiB (+0.0%) |
posthog-app/src/scenes/AuthenticatedShell.js |
276.9 KiB | 🔺 +4.4 KiB (+1.6%) |
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
✅ Eager graph — within 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.60 MiB · 22 files | no change | █████████░ 86.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.54 MiB · 629 files | 🔺 +573 B (+0.0%) | █████████░ 87.9% of 4.03 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
7.46 MiB · 2,395 files | 🔺 +15.5 KiB (+0.2%) | █████████░ 89.5% of 8.34 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] 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
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.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 |
| 854 B | src/scenes/ChunkLoadErrorBoundary.tsx |
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
| Size | File |
|---|---|
| 301.8 KiB | ../node_modules/.pnpm/posthog-js@1.434.14_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 216.9 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 |
| 100.5 KiB | src/lib/api.ts |
| 89.6 KiB | src/products.tsx |
| 69.4 KiB | src/lib/lemon-ui/icons/icons.tsx |
| 40.1 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 |
| 28.5 KiB | src/scenes/scenes.ts |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 301.8 KiB | ../node_modules/.pnpm/posthog-js@1.434.14_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.7 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 216.9 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 |
| 102.8 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 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 |
| 89.6 KiB | src/products.tsx |
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.17 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.17 MiB · 19 files | 🔺 +86 B (+0.0%) | ████░░░░░░ 38.0% of 5.72 MiB |
| Deferred (lazy) | 2.10 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 |
|---|---|
| 813.3 KiB | dist/toolbar/toolbar-app-BW77XXDE.css |
| 651.9 KiB | dist/toolbar/chunk-chunk-DJWLUZ3R.js |
| 259.4 KiB | dist/toolbar/chunk-chunk-4EKE7GSM.js |
| 138.3 KiB | dist/toolbar/chunk-chunk-QQ7R6XBZ.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-FDH2IBXT.js |
| 75.2 KiB | dist/toolbar/toolbar-app-NPMWAVD2.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-TSAL54PB.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-YL3B42H2.js |
| 21.0 KiB | dist/toolbar/chunk-chunk-KGGZKL3I.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 — 🔺 +367.4 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 952.09 MiB · 🔺 +367.4 KiB (+0.0%)
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a feature-flagged Codex subscription setting with account connection and disconnection flows. Adds billing controls for selecting PostHog credits or a ChatGPT plan. Task creation and run interaction logic resolve Codex model access, include it in run requests, and retain it in run state. Draft warming and warm reuse are adjusted for ChatGPT-plan runs. Adds tests, stories, and snapshot updates. 🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (2)
frontend/src/scenes/settings/user/CodexConnectModal.tsx-17-19 (1)
17-19: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winBlock modal dismissal while a connection is in flight.
The Cancel button is disabled while
connectingis true.onClosestill lets the user close the modal with Esc, an overlay click, or the X button. If the user closes the modal and the request then fails,connectErroris set for a modal that is no longer visible, so the user never sees the error. Passclosable={!connecting}.frontend/src/scenes/settings/user/personalCodexIntegrationLogic.ts-122-122 (1)
122-122: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPrevent focus loads from overwriting Codex mutations.
These three operations share
codexIntegration, and the Codex loader functions do not use the repository’s cooperative cancellation pattern. A focus GET can therefore settle after a successful connect or disconnect and replace the UI with an older response.The focus guard is necessary, but it is not sufficient. The connect button and modal submit can start a connect while a GET is already running. Guard those controls, and guard the disconnect confirmation callback or serialize all three operations at the logic boundary.
The impact is limited to stale UI state. The server-side mutation remains successful, and a later reload restores the correct state.
Suggested focus and connect guards
- events(({ actions, cache }) => ({ + events(({ actions, values, cache }) => ({ afterMount: () => { actions.loadCodexIntegration() cache.disposables.add( () => { - const onFocus = (): void => actions.loadCodexIntegration() + const onFocus = (): void => { + if (!values.connecting && !values.codexIntegrationLoading) { + actions.loadCodexIntegration() + } + } window.addEventListener('focus', onFocus) return () => window.removeEventListener('focus', onFocus) },- const { codexIntegration, codexIntegrationLoadFailed, connecting } = useValues(personalCodexIntegrationLogic) + const { codexIntegration, codexIntegrationLoadFailed, codexIntegrationLoading, connecting } = useValues( + personalCodexIntegrationLogic + ) ... - disabledReason={connecting ? 'Connecting…' : undefined} + disabledReason={connecting ? 'Connecting…' : codexIntegrationLoading ? 'Loading…' : undefined}Apply the same
codexIntegrationLoadingguard to the modal submit and the disconnect confirmation callback.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: d6fb1870-6bf0-4805-94d3-68674ede5ce8
📒 Files selected for processing (9)
frontend/src/lib/constants.tsxfrontend/src/scenes/settings/SettingsMap.tsxfrontend/src/scenes/settings/stories/SettingsUser.stories.tsxfrontend/src/scenes/settings/types.tsfrontend/src/scenes/settings/user/CodexConnectModal.tsxfrontend/src/scenes/settings/user/PersonalCodexIntegration.tsxfrontend/src/scenes/settings/user/codexAuthFile.test.tsfrontend/src/scenes/settings/user/codexAuthFile.tsfrontend/src/scenes/settings/user/personalCodexIntegrationLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review.
|
🕓 This approval covered an earlier revision. There are new visual changes to review in the newer comment below. ✅ Visual changes approved by @puemos — baseline updated in 6 new. Install the Visual Review Chrome extension to see visual review results at the top of your pull requests. |
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 (2)
frontend/src/scenes/settings/user/personalCodexIntegrationLogic.ts-24-25 (1)
24-25: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReport clipboard-clear failures.
When clipboard writes are denied,
writeTextrejects. This helper discards the rejection, so the sign-in remains on the clipboard without a warning. The modal nevertheless promises that PostHog clears it. Clipboard write permission can fail independently of a keyboard paste. (w3.org)Return an observable result. If clearing fails, tell the user to overwrite the clipboard manually. Change the privacy notice to describe the attempted cleanup rather than guarantee it.
Based on learnings: async clipboard helpers should not “silently catch and swallow errors internally.”
Source: Learnings
frontend/src/scenes/settings/user/CodexConnectModal.tsx-75-75 (1)
75-75: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winWrap the changing platform hint.
PLATFORM_HINTS[loginPlatform]changes beside a static text sibling. This is the text-node shape prohibited by the frontend translation guideline.Wrap the changing hint in its own element. Keep the surrounding instructions translatable.
Proposed fix
- {PLATFORM_HINTS[loginPlatform]} Open the link that it shows, sign in, and enter the one-time + <span>{PLATFORM_HINTS[loginPlatform]}</span> Open the link that it shows, sign in, and enter the one-timeAs per coding guidelines: “Don't leave a changing bare text node next to siblings.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: 5ea444c3-62c2-457b-8c25-85f2919bb2c4
📒 Files selected for processing (6)
frontend/src/scenes/settings/user/CodexConnectModal.tsxfrontend/src/scenes/settings/user/codexAuthFile.test.tsfrontend/src/scenes/settings/user/codexAuthFile.tsfrontend/src/scenes/settings/user/codexLoginCommands.test.tsfrontend/src/scenes/settings/user/codexLoginCommands.tsfrontend/src/scenes/settings/user/personalCodexIntegrationLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.
190e19e to
90ed2f3
Compare
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
|
@coderabbitai full review |
|
@greptileai review |
|
🦔 PostHog Review reviewed this pull requestFound 0 must fix, 4 should fix, 1 consider. Published 5 findings (view the review). |
|
[Medium risk] Adds ChatGPT account connection for Codex billing. The PR is not safe to merge until connecting from the composer selects the requested ChatGPT plan. Reviews (1) · Last reviewed commit: "fix(settings): close codex connect races..." |
|
PostHog Review alpha 🦔 If you find any issues helpful - please reply "valid", "invalid", etc., for evaluation purposes 🙏 |
|
🕓 This approval covered an earlier revision. There are new visual changes to review in the newer comment below. ✅ Visual changes approved by @puemos — baseline updated in 128 changed, 6 new, 6 removed. Install the Visual Review Chrome extension to see visual review results at the top of your pull requests. |
Users can connect the ChatGPT account for Codex cloud tasks from web settings, next to GitHub and Slack. They run codex login in their own terminal and paste auth.json. The row reads the same backend record as PostHog Desktop, so a Desktop connection shows up on web. Gated by posthog-code-codex-own-subscription-cloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
The connect dialog now tells users to run codex login --device-auth, and to turn on device code login in ChatGPT first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
The section description above the row already says the same thing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
6 updated Run: 65463936-b6cb-403c-bdb4-3eb9f126f932 Co-authored-by: puemos <13174025+puemos@users.noreply.github.com>
The inline logic types did not match what kea-typegen writes, so the frontend typecheck job failed its typegen diff check. Type the disconnect loader so typegen infers the same shape as the other loaders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
…n paste The connect dialog now gives one command for macOS, Linux, or Windows, picked from the browser. The command signs in with a device code in a temporary CODEX_HOME, forces file credential storage, copies auth.json to the clipboard, and deletes the folder, also on Ctrl+C. The paste field never shows the sign-in, connects on paste, and clears the clipboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
The web task composer's model menu gets a Billing row on the Codex harness: PostHog credits or the user's ChatGPT plan. The choice is kept per browser, the plan needs a connected ChatGPT account, and the menu can open the connect dialog in place. New tasks and resumed runs send codex_model_access, and a run on the plan pins the Codex model and skips warm reuse. Behind posthog-code-codex-own-subscription-cloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
The Codex row leaves Personal integrations for a new Subscriptions section in the AI settings group, next to Model preferences, under the same flag. The Codex stories move to the environment settings stories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
A clipboard read that ends after the dialog closes no longer connects. A focus reload that ends after a connect or disconnect no longer overwrites it. The dialog cannot close while a connect is in flight, a failed clipboard clear shows a warning, and the platform hint is its own element for page translation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
…mposer Kea runs reducers before listeners, so connectCodexSuccess cleared the pending plan pick before the listener could read it, and billing stayed on PostHog credits. The pick is now cleared by the plan selection itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
…e warms A seeded task can submit before the billing picker mounts, so the new-task submit now reads the saved choice and the ChatGPT connection itself. A draft on the ChatGPT plan no longer boots a warm sandbox it can't use, and switching to the plan releases one. The connect dialog names the Codex CLI, drops an invalid paste, and ignores a second clipboard read while a connect runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
134 updated, 6 removed Run: 00913d73-94ab-47ff-b7ab-9ea9cbdd6d40 Co-authored-by: puemos <13174025+puemos@users.noreply.github.com>
f61ba53 to
2706704
Compare
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. Install the Visual Review Chrome extension to see visual review results at the top of your pull requests. |
|
@coderabbitai full review |
|
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)
products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts-760-760 (1)
760-760: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDerive
currentCodexModelAccessfrom the resolved access.When a seeded task submits before the Codex billing picker mounts,
usesChatGptPlan(composerAdapter)returnsfalsebecause it reads only the mounted billing logic.codexModelAccessForRuncan then resolveOwnSubscriptionfrom the saved preference and connected integration. The optimistic interaction starts withnull, and the fallback preserves that value when the run state omitscodex_model_access. The UI can therefore show “PostHog credits” for a run billed to the ChatGPT plan.Resolve
codexModelAccessForRunbefore constructingrunInteractionLogic, or update the interaction after resolution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: ba9830f2-61a0-4a76-8855-e59bc248174a
📒 Files selected for processing (23)
frontend/snapshots.ymlfrontend/src/lib/constants.tsxfrontend/src/scenes/settings/SettingsMap.tsxfrontend/src/scenes/settings/stories/SettingsEnvironment.stories.tsxfrontend/src/scenes/settings/types.tsfrontend/src/scenes/settings/user/CodexConnectModal.tsxfrontend/src/scenes/settings/user/PersonalCodexIntegration.tsxfrontend/src/scenes/settings/user/codexAuthFile.test.tsfrontend/src/scenes/settings/user/codexAuthFile.tsfrontend/src/scenes/settings/user/codexLoginCommands.test.tsfrontend/src/scenes/settings/user/codexLoginCommands.tsfrontend/src/scenes/settings/user/personalCodexIntegrationLogic.test.tsfrontend/src/scenes/settings/user/personalCodexIntegrationLogic.tsproducts/posthog_ai/frontend/components/composer/ComposerCodexBillingPickers.tsxproducts/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.test.tsxproducts/posthog_ai/frontend/components/composer/ComposerModelEffortPickers.tsxproducts/posthog_ai/frontend/logics/codexBillingLogic.test.tsproducts/posthog_ai/frontend/logics/codexBillingLogic.tsproducts/posthog_ai/frontend/logics/runInteractionLogic.tsproducts/posthog_ai/frontend/scenes/TaskTracker/components/TaskComposer.tsxproducts/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsxproducts/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsxproducts/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 6 remain after this review.
…ion loads A resume sent before the ChatGPT connection loaded stated PostHog credits and moved a plan run off the plan. With a saved plan and an unknown connection, the resume now leaves the field off so the run keeps its billing. A seeded task also shows the billing it resolved when the run state omits it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59c79143-386a-4043-9109-6e3a2e4fa61f
Problem
codex loginin its own terminal. Web cannot do that, so the user must run a command on their computer and bring the result back.Changes
Settings: Project > AI > Subscriptions > Codex
/api/users/@me/integrations/codex/record, so a connection made in Desktop shows up on web. The row reloads when the window gets focus.Connect dialog (device code flow only)
codex login --device-authin a temporaryCODEX_HOME, forces file credential storage, copiesauth.jsonto the clipboard, and deletes the folder, also on Ctrl+C. The sign-in never shows in the terminal, nothing stays on the computer, and~/.codexis never touched, so the local Codex sign-in keeps working.Task composer billing
codex_model_access. A run on the plan pins the Codex model and skips warm reuse, because a warm sandbox holds no ChatGPT token. When the flag is on, the choice is always sent: a resume otherwise keeps the old billing, and the backend refuses the plan on Claude.codexBillingLogic, so users without the flag never load their ChatGPT connection.Rollout: the
posthog-code-codex-own-subscription-cloudflag gates the settings section and the billing row. The backend already checks the same flag on connect and on run start. There is no backend change.Note
Desktop's "Cloud tasks" toggle still decides if a Desktop run uses the ChatGPT plan. The web choice applies to runs started on web.
How did you test this code?
codexAuthFile.test.tschecks the paste parser. It catches a parser that accepts an API-keyauth.json, or that fails to read the tokens.codexLoginCommands.test.tschecks the platform detection. It catches a macOS browser that gets the Windows command, becausedarwincontainswin.ComposerModelEffortPickers.test.tsxchecks that Billing is absent on Claude, that the plan is disabled until an account is connected, and that a connected account can switch to it.codexin bash, zsh, fish, and PowerShell 7. Each put the token on the clipboard, printed only "Copied", and deleted the folder after success, failure, and a real Ctrl+C in a pseudo-terminal. PowerShell also restores the previousCODEX_HOME. The real Codex CLI 0.154.0 accepted-c cli_auth_credentials_store=fileand wrote only a login log before sign-in.branchkey (no warm reuse) and a run create withcodex_model_access: "own-subscription"and the pinned Codex model.SettingsEnvironment.stories.tsxand from Storybook with the flag on..cmdlauncher), Waylandwl-copy, and a sync with a real Desktop app.Release status
Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: PostHog Desktop, Claude Opus 5.5 (
claude-opus-5-5)jane@example.com, fake tokens) is invented.Created with PostHog Desktop
🤖 Generated with Claude Code