Skip to content

feat(codex): attribute usage to launch accounts - #13273

Closed
rp0927 wants to merge 9 commits into
stablyai:mainfrom
rp0927:feat/codex-account-usage-attribution
Closed

rp0927 wants to merge 9 commits into
stablyai:mainfrom
rp0927:feat/codex-account-usage-attribution

Conversation

@rp0927

@rp0927 rp0927 commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Codex usage events and rollups can now retain an optional launch-account attribution. The scanner combines managed-home roots with bounded session-launch evidence, keeps same-day usage from different accounts in separate rollups, and preserves cached attribution after transient launch evidence expires.

The Stats pane adds account filtering for managed, system, unattributed, and removed accounts. Older persisted usage caches that predate account attribution are rejected and rebuilt instead of being interpreted under the new schema.

This PR is stacked on #13272, #13271, #13270, and #13183. Please review it after those PRs land; their changes will disappear from this diff as the stack advances.

Screenshots

Not attached yet because this is a dependency-gated draft. Before marking it ready, I will capture the Codex Stats account filter against the rebased branch.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions

Focused validation:

  • Focused Vitest suite covering hook attribution, scanner roots, store schema/rollups, session-account evidence, Stats filtering, and bounded filter contracts — 317 tests passed.
  • pnpm run build:desktop — passed.
  • git diff --check — passed.

Local environment note: the repository requests Node 24, while this workstation currently exposes Node 25.8.1. The desktop build completed; its development CLI install step reported the expected permission warning for /usr/local/bin/orca-dev without failing the build.

AI Review Report

The review traced account attribution from live Codex launches and managed-home scan roots into usage events, persisted snapshots, aggregate rollups, IPC filters, renderer state, and Stats display. It checked legacy schema invalidation, same-day account separation, deleted-account labels, and loss of transient launch evidence.

Regression tests cover managed/system attribution, first-evidence retention, malformed persisted registry rows, rescanning after late attribution, cached attribution retention, separate account rollups, owned-root boundaries, old-schema invalidation, combined workspace/account filters, and removed account options.

Cross-platform review:

  • Managed-home scanning uses the existing host/WSL path ownership checks and rejects roots redirected outside managed storage.
  • Account attribution is optional, so legacy/system sessions without evidence remain queryable as unattributed usage.
  • No SSH credential assumptions are added to the local scanner.

Security Audit

  • Usage records persist only an opaque account ID and account kind; provider identity fields and credentials are excluded.
  • Session-account evidence is bounded, validates persisted rows, and keeps the first observed account rather than allowing later reassignment.
  • Scanner roots are canonicalized and constrained to owned account homes, including nested session-root checks.
  • Account filter input is length-bounded and structurally validated before IPC/store queries.
  • Dependencies and credential formats are unchanged.

Notes

@rp0927

rp0927 commented Aug 13, 2026

Copy link
Copy Markdown
Author

Rebased onto current origin/main (392 commits). Conflict resolutions kept main’s usage-provider IPC/lifecycle and PTY cwd prevalidation, and ported account-filter / managed-home behavior onto those paths. Localization keys were merged rather than dropped. Stack branches were force-pushed with --force-with-lease. GitHub will not accept another fork branch as the base, so these PRs still target main and still contain the full stack below them — review bottom-up starting at #13183.
This layer now threads accountFilter through the shared usage-provider handlers/slices instead of the deleted ipc/codex-usage.ts and store/slices/codex-usage.ts.

@rp0927
rp0927 marked this pull request as ready for review August 13, 2026 14:19
@rp0927
rp0927 requested a review from brennanb2025 as a code owner August 13, 2026 14:19
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds Codex account-scoped terminal launches for CLI and renderer flows. It validates provider account references, runtime lanes, WSL distributions, and runtime capabilities. Codex session attribution is persisted and included in usage aggregation and filtering. PTY-scoped model discovery now resolves account-specific environments and dynamic Codex model options. Shared IPC, preload, runtime, transport, state, and localization contracts carry the new account data.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main change and testing, but it omits required ELI5, Why, Linked Issue, AI Disclosure, Review, and Checklist sections. Add the missing template sections, provide a valid issue link in “Fixes #”, complete the checklist, and document AI disclosure and review considerations.
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: attributing Codex usage to launch accounts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang requested a review from OrcaWin August 13, 2026 16:51
@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch 2 times, most recently from 0c68ddf to cf13262 Compare August 14, 2026 03:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts (1)

63-71: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Keep persisted-option validation in the requested discovery scope.

Line 63 scans model lists from every PTY for the agent. After pty-a completes discovery, a launch for pty-b can reject its valid account-specific model because it is absent from pty-a's list.

Pass hostKey and ptyId into this resolver, then inspect only that scope. If no result exists for that scope, retain the persisted values. The new tests already establish that Codex model lists differ by PTY/account.

src/renderer/src/store/slices/usage-provider-slices.ts (1)

168-204: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Guard against out-of-order snapshot applies.

setCodexUsageAccountFilter sets the filter and then awaits fetchCodexUsage. If the user changes the account filter again before the first run finishes, two fetchUsage runs overlap. Each run applies update(refreshedSnapshot) and mapSnapshotExtras unconditionally, so the run that resolves last wins. The last run is not necessarily the run for the newest filter.

The Stats pane then shows usage for a filter the user already replaced, and nothing re-fetches until the next user action.

Track a per-provider request generation and drop applies from a superseded run.

♻️ Proposed guard
   return (set, get) => {
+    let requestGeneration = 0
     const update = (patch: Partial<UsageData<T>>): void =>
       set(createUsagePatch(config.prefix, patch))
     const read = (): UsageData<T> => readUsageData<T>(get(), config.prefix)
 
     const fetchUsage = async (opts?: { forceRefresh?: boolean }): Promise<void> => {
+      const generation = ++requestGeneration
+      const isStale = (): boolean => generation !== requestGeneration
       try {
         await api.refresh({ force: opts?.forceRefresh ?? false })
         const refreshedSelection = read()
         const refreshedSnapshot = await api.getSnapshot({
           scope: refreshedSelection.scope,
           range: refreshedSelection.range,
           limit: 10,
           ...config.getExtraSnapshotArgs?.(get())
         })
+        if (isStale()) {
+          return
+        }
         update(refreshedSnapshot)
🧹 Nitpick comments (5)
src/renderer/src/components/terminal-pane/pty-transport.test.ts (1)

117-133: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Strengthen the test to match its stated claim.

The test name states that the transport forwards the account reference "without exposing a credential path." The assertion only checks with objectContaining, which does not fail if extra fields are present. Add a negative assertion, for example checking that the spawn payload contains only the expected keys or that no home/credential-path field is present. Otherwise, a future change that adds a resolved credential path to the spawn payload would pass this test undetected.

src/main/ipc/pty.test.ts (1)

2182-2215: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the agent-mismatch rejection.

These two tests cover the malformed-shape and SSH-runtime rejections. The third guard in registerPtyHandlers remains untested: pty.ts throws agent_session_account_agent_mismatch when args.launchAgent !== 'codex' or providerAccountRef.provider !== 'codex'. That guard prevents a Codex account reference from scoping a non-Codex launch.

♻️ Proposed additional test
+    it('rejects a Codex account reference for a non-Codex launch agent', async () => {
+      registerPtyHandlers(mainWindow as never)
+
+      await expect(
+        handlers.get('pty:spawn')!(null, {
+          cols: 80,
+          rows: 24,
+          command: 'claude',
+          launchAgent: 'claude',
+          providerAccountRef: { provider: 'codex', accountId: 'account-a', runtime: 'host' }
+        })
+      ).rejects.toThrow('agent_session_account_agent_mismatch')
+      expect(spawnMock).not.toHaveBeenCalled()
+    })
src/main/ipc/pty.ts (1)

5952-5968: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Replace the throwing ternary with a plain guard.

The nested ternary with an immediately invoked throwing arrow function obscures a simple validation gate. A guard statement gives the same narrowing with less indirection.

♻️ Proposed simplification
-      const providerAccountRef =
-        args.providerAccountRef === undefined
-          ? undefined
-          : isProviderAccountRef(args.providerAccountRef)
-            ? args.providerAccountRef
-            : (() => {
-                throw new Error('Invalid provider account reference')
-              })()
+      if (args.providerAccountRef !== undefined && !isProviderAccountRef(args.providerAccountRef)) {
+        throw new Error('Invalid provider account reference')
+      }
+      const providerAccountRef = args.providerAccountRef
       if (
         providerAccountRef &&
         (args.launchAgent !== 'codex' || providerAccountRef.provider !== 'codex')
       ) {
src/renderer/src/store/slices/usage-provider-slices.ts (2)

56-61: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider typing the extra snapshot arguments.

accountFilter?: unknown and getExtraSnapshotArgs?: (state) => Record<string, unknown> erase the shape of the request extension. getExtraSnapshotArgs results are spread into the getSnapshot payload at Line 173 and Line 199, so a misspelled key compiles and silently sends no filter.

This file already imports CodexUsageAccountFilter. Consider adding an extra-args type parameter to UsageProviderConfig and UsageApi so the provider config and the preload signature stay aligned.

Also applies to: 88-89


233-239: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace the fabricated snapshot with a dedicated reset hook.

This code builds an object that holds only accountOptions and casts it to T['snapshot']. The cast is unsound, because T['snapshot'] also requires scanState, summary, daily, and the breakdown fields.

The current Codex mapper reads only snapshot.accountOptions, so nothing fails today. If a future mapSnapshotExtras reads any other snapshot field, this call dereferences undefined and the cast hides the defect from the type checker.

Add an explicit reset hook to UsageProviderConfig and call it here.

♻️ Proposed change
   getExtraSnapshotArgs?: (state: AppState) => Record<string, unknown>
   mapSnapshotExtras?: (snapshot: T['snapshot']) => Partial<AppState>
+  resetSnapshotExtras?: () => Partial<AppState>
 }
-        if (config.mapSnapshotExtras) {
-          set({
-            ...config.mapSnapshotExtras({
-              accountOptions: []
-            } as T['snapshot'])
-          })
-        }
+        if (config.resetSnapshotExtras) {
+          set(config.resetSnapshotExtras())
+        }
   mapSnapshotExtras: (snapshot) => ({
     codexUsageAccountOptions: snapshot.accountOptions ?? []
-  })
+  }),
+  resetSnapshotExtras: () => ({ codexUsageAccountOptions: [] })
 })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9dab9197-8bcd-495d-bbf8-439f4c877c79

📥 Commits

Reviewing files that changed from the base of the PR and between 400321e and 0c68ddf76f0f44602f61872c87704634ede97561.

📒 Files selected for processing (92)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/types.ts

Comment thread src/main/index.ts Resolved
Comment on lines +25462 to +25481
if (request.providerAccountRef) {
if (request.agent !== 'codex' || request.providerAccountRef.provider !== 'codex') {
throw new Error('agent_session_account_agent_mismatch')
}
if (workspace.connectionId) {
throw new Error('agent_session_account_runtime_mismatch')
}
const wsl = parseWslUncPath(workspace.path)
if ((request.providerAccountRef.runtime === 'wsl') !== Boolean(wsl)) {
throw new Error('agent_session_account_runtime_mismatch')
}
if (
wsl &&
request.providerAccountRef.wslDistro?.trim() &&
request.providerAccountRef.wslDistro.trim().toLocaleLowerCase('en-US') !==
wsl.distro.toLocaleLowerCase('en-US')
) {
throw new Error('agent_session_account_runtime_mismatch')
}
}

@coderabbitai coderabbitai Bot Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Extract the duplicated provider-account/workspace validation into one helper.

ensureAgentSession (Line 25462-25481) and createAgentSession (Line 25641-25662) implement identical checks: agent/provider mismatch, SSH-workspace rejection, WSL runtime parity, and WSL distro parity, each throwing the same four error codes. This duplicates security-relevant account-isolation logic across two entry points. A future fix or new check applied to one copy can silently miss the other.

Extract a private method, for example assertProviderAccountRefMatchesWorkspace(providerAccountRef, agent, workspace), and call it from both sites. This also gives a single place to close the related gap: any other caller of createTerminal that sets providerAccountRef directly (bypassing ensureAgentSession/createAgentSession) currently skips this validation entirely, since createTerminal itself does not call it.

♻️ Proposed extraction
+  private assertProviderAccountRefMatchesWorkspace(
+    providerAccountRef: ProviderAccountRef | undefined,
+    agent: TuiAgent,
+    workspace: TerminalWorkspaceLaunchScope
+  ): void {
+    if (!providerAccountRef) {
+      return
+    }
+    if (agent !== 'codex' || providerAccountRef.provider !== 'codex') {
+      throw new Error('agent_session_account_agent_mismatch')
+    }
+    if (workspace.connectionId) {
+      throw new Error('agent_session_account_runtime_mismatch')
+    }
+    const wsl = parseWslUncPath(workspace.path)
+    if ((providerAccountRef.runtime === 'wsl') !== Boolean(wsl)) {
+      throw new Error('agent_session_account_runtime_mismatch')
+    }
+    if (
+      wsl &&
+      providerAccountRef.wslDistro?.trim() &&
+      providerAccountRef.wslDistro.trim().toLocaleLowerCase('en-US') !==
+        wsl.distro.toLocaleLowerCase('en-US')
+    ) {
+      throw new Error('agent_session_account_runtime_mismatch')
+    }
+  }

Then replace both inline blocks with:

-    if (request.providerAccountRef) {
-      if (request.agent !== 'codex' || request.providerAccountRef.provider !== 'codex') {
-        throw new Error('agent_session_account_agent_mismatch')
-      }
-      if (workspace.connectionId) {
-        throw new Error('agent_session_account_runtime_mismatch')
-      }
-      const wsl = parseWslUncPath(workspace.path)
-      if ((request.providerAccountRef.runtime === 'wsl') !== Boolean(wsl)) {
-        throw new Error('agent_session_account_runtime_mismatch')
-      }
-      if (
-        wsl &&
-        request.providerAccountRef.wslDistro?.trim() &&
-        request.providerAccountRef.wslDistro.trim().toLocaleLowerCase('en-US') !==
-          wsl.distro.toLocaleLowerCase('en-US')
-      ) {
-        throw new Error('agent_session_account_runtime_mismatch')
-      }
-    }
+    this.assertProviderAccountRefMatchesWorkspace(request.providerAccountRef, request.agent, workspace)

Also applies to: 25641-25662

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on this stack: ensureAgentSession and createAgentSession both call assertProviderAccountRefForWorkspace in src/main/runtime/provider-account-workspace-scope.ts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline src/main/runtime/provider-account-workspace-scope.ts --items all --view expanded
ast-grep outline src/main/runtime/orca-runtime.ts --match 'ensureAgentSession|createAgentSession' --view expanded

printf '\n--- helper references ---\n'
rg -n -C 5 '\bassertProviderAccountRefForWorkspace\s*\(' \
  src/main/runtime/provider-account-workspace-scope.ts \
  src/main/runtime/orca-runtime.ts

Length of output: 1026


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- candidate helper files ---'
fd -i 'provider.*account.*workspace.*scope' . || true

printf '%s\n' '--- helper definitions and call sites ---'
rg -n -C 6 '\bassertProviderAccountRefForWorkspace\s*\(' . || true

printf '%s\n' '--- ensure/create agent-session definitions ---'
rg -n -P -C 8 '\b(ensureAgentSession|createAgentSession)\s*\(' src/main/runtime/orca-runtime.ts || true

printf '%s\n' '--- inline provider-account validation in the runtime service ---'
rg -n -C 5 'agent_session_account_(agent_mismatch|runtime_mismatch)' src/main/runtime/orca-runtime.ts || true

Length of output: 5143


@rp0927, verification is inconclusive for the stated stack change. The checked-out revision has no provider-account-workspace-scope.ts file and no assertProviderAccountRefForWorkspace reference. It still contains two inline validation blocks in ensureAgentSession and createAgentSession.

Please update this PR revision or provide the commit that contains the extraction. The finding remains open.

You are interacting with an AI system.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extraction is on a later stack commit, not on this PR's head. assertProviderAccountRefForWorkspace lives in src/main/runtime/provider-account-workspace-scope.ts from 5615a1999, and both ensureAgentSession and createAgentSession call it on tip 82763dc2f (#13276). This PR's branch stops before that commit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rp0927, thanks for the clarification.

The extraction is outside #13273. The duplication remains in this PR revision, so this thread cannot be marked addressed here. Commit 5615a1999 and #13276 track the extraction on the later stack tip.

You are interacting with an AI system.

@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch 3 times, most recently from 7422fa0 to 899d6ab Compare August 14, 2026 10:56
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx (1)

135-135: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use renderer typography tokens.

Replace text-[12px] and text-[10px] with typography tokens from src/renderer/src/assets/main.css.

As per coding guidelines: “use tokens from src/renderer/src/assets/main.css” and “do not invent documented colors, font sizes, or shadow tiers.”

Also applies to: 196-196

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 02469244-c4a4-4875-8513-974856932948

📥 Commits

Reviewing files that changed from the base of the PR and between cb42b60 and 899d6ab75dbc920089f44d69fc1e79383bdf64cd.

📒 Files selected for processing (94)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/git-inspection-api.ts
  • src/preload/api/pty-api.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (87)
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/ipc/filesystem.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/main/agent-hooks/server.ts
  • src/renderer/src/components/terminal-pane/pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/shared/provider-account-ref.test.ts
  • src/cli/help.ts
  • src/cli/handlers/account.test.ts
  • src/cli/specs/core.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/main/codex-usage/scanner.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/usage/usage-provider-contract.ts
  • src/shared/protocol-version.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/preload/index.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/codex-usage/store.test.ts
  • src/main/agent-hooks/server.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/cli/handlers/terminal.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/main/ipc/filesystem.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/shared/agent-session-option-catalog.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/shared/agent-session-host-authority.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/preload/usage-provider-api.ts
  • src/main/codex-usage/store.ts
  • src/cli/handlers/terminal.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/shared/provider-account-ref.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/index.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/main/ipc/pty.test.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/main/ipc/pty.ts

@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch 2 times, most recently from 955b58c to c9fdc96 Compare August 15, 2026 06:37
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch from c9fdc96 to eea9a71 Compare August 15, 2026 08:47
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aafd7c52-b85c-4d88-aa0e-dfc14ab472b4

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7f442 and eea9a710844b8a1dd963b845580b1462855a6e53.

📒 Files selected for processing (87)
  • src/cli/handlers/account.test.ts
  • src/cli/handlers/account.ts
  • src/cli/handlers/terminal.test.ts
  • src/cli/handlers/terminal.ts
  • src/cli/help.ts
  • src/cli/specs/core.ts
  • src/main/agent-hooks/server.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/codex-usage/scanner.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/codex-usage/store.ts
  • src/main/codex-usage/types.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/main/index.ts
  • src/main/ipc/filesystem.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/main/usage/usage-provider-contract.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/main/usage/usage-rollup-records.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/git-inspection-api.ts
  • src/preload/api/pty-api.ts
  • src/preload/index.ts
  • src/preload/usage-provider-api.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/shared/agent-session-host-authority.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-model-list-probe.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/shared/codex-usage-types.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/protocol-version.ts
  • src/shared/provider-account-ref.test.ts
  • src/shared/provider-account-ref.ts
  • src/shared/worktree/launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (84)
  • src/renderer/src/store/slices/usage-snapshot-refresh.benchmark.test.ts
  • src/main/codex-usage/store-snapshot.benchmark.test.ts
  • src/main/runtime/rpc/methods/git.test.ts
  • src/renderer/src/runtime/remote-agent-session-launch.test.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
  • src/cli/help.ts
  • src/main/runtime/orca-runtime-agent-session-operation.test.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.test.ts
  • src/main/codex/codex-session-account-attribution.test.ts
  • src/main/usage/usage-event-aggregation.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/codex-usage-account-filter-contract.ts
  • src/preload/usage-provider-api.ts
  • src/shared/codex-usage-account-filter-contract.test.ts
  • src/main/codex-usage/codex-usage-provider.ts
  • src/shared/codex-model-list-probe.test.ts
  • src/shared/codex-usage-types.ts
  • src/preload/api/agent-usage-api.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/agent-hooks/server.ts
  • src/main/codex-usage/scanner.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/shared/provider-account-ref.test.ts
  • src/main/ipc/usage-provider-handlers.test.ts
  • src/main/runtime/rpc/methods/agent-session.ts
  • src/main/codex-usage/types.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/preload/api/git-inspection-api.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/shared/agent-session-option-catalog-claude-codex.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/shared/provider-account-ref.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
  • src/main/codex-usage/scanner-paths.test.ts
  • src/main/usage/usage-provider-contract.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/stats/CodexUsagePane.tsx
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/runtime/remote-agent-session-launch.ts
  • src/shared/worktree/launch-types.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/cli/specs/core.ts
  • src/main/codex/codex-session-account-registry.test.ts
  • src/main/codex/codex-session-account-attribution.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/shared/protocol-version.ts
  • src/preload/api/pty-api.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
  • src/shared/codex-model-list-probe.ts
  • src/main/text-generation/commit-message-agent-environment.test.ts
  • src/main/runtime/rpc/methods/agent-session.test.ts
  • src/main/codex/codex-session-account-registry.ts
  • src/cli/handlers/account.test.ts
  • src/shared/commit-message-agent-spec.ts
  • src/renderer/src/components/stats/codex-usage-account-filter.ts
  • src/renderer/src/components/tab-bar/codex-launch-account-options.ts
  • src/main/usage/usage-rollup-merge.ts
  • src/renderer/src/store/slices/usage-provider-slices.ts
  • src/cli/handlers/terminal.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/main/codex-usage/store.ts
  • src/preload/index.ts
  • src/main/ipc/usage-provider-handlers.ts
  • src/main/index.ts
  • src/main/text-generation/commit-message-agent-environment.ts
  • src/main/ipc/filesystem.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/lib/runtime-agent-background-create.ts
  • src/shared/agent-session-host-authority.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/cli/handlers/terminal.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/main/usage/usage-rollup-records.ts
  • src/main/ipc/pty.ts

@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch 2 times, most recently from 9ab76d5 to 4050575 Compare August 15, 2026 13:23
@rp0927

rp0927 commented Aug 15, 2026

Copy link
Copy Markdown
Author

Restacked onto current origin/main (c0a775454); force-pushed with --force-with-lease. New head: 405057596.

The stack was also restructured so each PR is green on its own head — previously every follow-up fix landed on the tip (#13276), which meant ancestor heads failed typecheck/oxlint standalone and reviewers (including CodeRabbit) were reading a snapshot without the fixes. Details in #13276 (comment).

This head was verified standalone: typecheck:node, typecheck:web, typecheck:cli, oxlint all pass.

Added here: 405057596 infers the account-filter type through the usage provider handlers (unknown broke parameter contravariance against each store) and splits the usage slice factory out of a file that had passed its 300-line budget.

rp0927 and others added 7 commits August 16, 2026 07:51
launch-agent-in-new-tab.test.ts grew past the 800-line budget once the
account-scoped cases landed; move those cases to their own file.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
main dropped the shared/types barrel, so the CLI terminal handler and the
launch account options resolved neither import.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
`unknown` for accountFilter broke parameter contravariance against each
provider store, and the slice file passed its max-lines budget once the
account-scoped state landed; split the factory out.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
@rp0927
rp0927 force-pushed the feat/codex-account-usage-attribution branch from 4050575 to 90ba2a3 Compare August 15, 2026 22:59
@nwparker nwparker removed the P2 label Aug 19, 2026
@rp0927 rp0927 closed this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants