Skip to content

Codex conversations continue under every account - #30957

Closed
brennanb2025 wants to merge 29 commits into
mainfrom
brennanb2025/codex-thread-rollout-identity
Closed

brennanb2025 wants to merge 29 commits into
mainfrom
brennanb2025/codex-thread-rollout-identity

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1627 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2797 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1170
Prod 51 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1206 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1019 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​187

ELI5

Continuing a Codex conversation under another account could leave the first account with an older history after Undo. Each account had its own database selecting the conversation's current file. This change keeps each conversation in its original folder and lets every selected account use that folder's same database and writer locks.

What Changed

New conversations use the configured Codex session folder, or the system Codex home by default. Existing conversations stay where they were written. Terminal launches, native chats, restarts, Session History resumes and headless launches resolve the login and conversation folder through one resolver. An account gets a small launch folder containing its login links and directory links into that conversation folder; changing accounts changes the login without copying the conversation or its database.

The launch folder is created atomically and keyed by the canonical conversation-folder path. Its config points SQLite at that folder's effective database location and uses file credentials. Login, config, title indexes and caches retain their existing ownership rules. Removing an account removes its credentials while keeping its conversations and the directory aliases that Codex's database rows still reference.

The old per-rollout bridges and their native index-healing work are retired. This removes synchronous main-process filesystem work on every launch that was measured at roughly three seconds in a user profile. The in-place migration, migration journal and History lineage changes previously on this branch have been removed.

Why

Account credentials stay separate from conversation storage. Keeping one database and lock directory per conversation removes the account-switch Undo bug without changing a running terminal's home, moving saved conversations, replaying metadata or copying mutable rollout files.

Linked Issue

Tracked in STA-11187.

Visual Proof

N/A — no interface layout changes. The lane owner will attach the required running-app evidence for account switching, Undo and legacy resumes before readiness.

Testing

  • Automated tests cover directory links and private entries, one SQLite current pointer across A → B → A after Undo, an old conversation resumed with another account, unchanged legacy config, logout versus later re-authentication, retained conversations on account removal, cross-store terminal-writer admission, launch/read routing and capability-gated older-host behavior.
  • Named Vitest runs on macOS passed through the machine test gate. CI provides lint and typecheck validation.
  • Running-app QA, Windows junction validation and the independent review loop remain with the lane owner; this builder did not launch Orca.

Review

The History scanner changes for revert lineage and one row per conversation are saved for the later History PR in this lane. The companion chat-account change makes already-open chats follow the current selection at their next turn; this PR supplies the shared resolver and storage behavior it needs.

Agent skill upstream boundary

  • Not applicable: this change copies no upstream skill-installer material.

Notes

  • Intended: old conversation folders are never converted, imported from or pruned. Their conversations remain available through Orca Session History and do not appear in the new shared folder's own Codex picker.
  • Intended: account removal preserves conversations and directory aliases, including per-overlay title indexes. These aliases remain while their conversation folder lives; uninstalling or resetting Orca's app data can strand database paths into those aliases.
  • Auth repair still required before merge: account login files currently stay in their existing home, with path links on macOS/Linux and identity-checked hard links on Windows. Review found that ordinary native sign-in/sign-out can detach those links and that the current receipt does not safely order refresh, logout and Settings re-authentication. This contract is under review; the current branch is not ready to merge. The existing limit for an already-running Windows process retaining its earlier credential does not excuse losing a completed sign-in.
  • Intended: config stays mirrored and session title indexes stay local to each launch folder rather than being shared files. This preserves existing config promotion and Codex's atomic index rewrites; History reads the indexes across aliases of the same store.
  • Intended known limit: an old shell typing codex resume on the other folder while the chat is open can still open a pre-upgrade bridge alias under another lock folder. This shape exists today. Outside the scoped System default without a file login case below, Orca creates no new cross-folder rollout aliases, never starts that second writer itself, and compares thread ids across stores in its chat-versus-terminal admission. The old-shell case ends when terminals opened before the upgrade close.
  • Temporary: WSL keeps its existing guest-side per-home bridge, which runs outside the main process and skips already-bridged files; tracked in STA-12563. Store overlays are capability-advertised; older paired servers retain the existing account-home path and their chats do not follow account changes.
  • Intended (implementation required before merge): when System default is selected and its Codex home has no auth.json file, a new conversation starts in ~/.codex, even with a custom session source folder. When the System default Codex login isn’t a file (keychain, API-key provider, or signed out), continuing a conversation from another folder links it into ~/.codex exactly as Orca’s terminal restart already does; its history can diverge between the two folders as on main. The current refusal must be replaced with that terminal mechanism, awaiting its no-overwrite link/copy before launch. This is the only exception to the named-store and no-new-rollout-alias rules; a System default file login and managed accounts keep them.

Checklist

  • Explained the user-visible change, mechanism and alternatives.
  • Cross-platform, SSH and mixed-version behavior considered.
  • Automated regression coverage added and updated.
  • CI green on the final head.
  • Lane-owner review and running-app QA complete.

…erts

Each Orca Codex account home kept its own Codex database while sharing the
conversation files, so a revert or edit under one account left the others
resuming older history, and History listed one row per rollout file.

- Account homes now link their conversation folders to one store per host
  and point Codex's sqlite_home at it, migrated once in the background.
- History keys Codex rows by thread id, picks the segment Codex resumes, and
  stitches inherited history from the revert's base.
- Native chat resumes by thread id and reads transcripts across segments.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 20, 2026 01:47
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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

Codex launches now use account overlays to separate login files from conversation stores. Launch resolution accepts a conversation home, and configuration writes set shared-store options for overlays. Session discovery and resume paths use store-aware indexes and selected rollout data. Account cleanup retains conversation-store data while removing authentication files. The changes also remove session-bridging and migration routines and update related tests.

Priority: Normal

Merge Risk: Moderate · previous review 979fc

Removing a Codex account can leave its credentials on disk without any error being reported. One stale account overlay can also break session history, usage discovery and ownership listing for every account. Fix these before merging.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: Codex conversations remain usable when users switch 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.
Description check Passed The pull request description is detailed and covers the required explanation, changes, rationale, issue reference, visual proof, testing, review notes, limitations, and checklist. It clearly identifie…
Full details: Description check

Explanation

The pull request description is detailed and covers the required explanation, changes, rationale, issue reference, visual proof, testing, review notes, limitations, and checklist. It clearly identifies incomplete CI, QA, and review work. The issue is referenced as STA-11187 but is not linked directly, and the AI Disclosure section is omitted; these are minor template gaps.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@brennanb2025
brennanb2025 marked this pull request as draft October 20, 2026 01:50
@brennanb2025
brennanb2025 marked this pull request as ready for review October 20, 2026 01:51

@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: 5

🧹 Nitpick comments: 1
src/main/codex/codex-current-rollout-selection.ts: 1

24-24: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Cache the effective SQLite home per Codex home.

resolveEffectiveCodexSqliteHome(home) runs a synchronous readFileSync of config.toml on every call. The CodexSelectionCache only caches the database read, not this config read.

The cost is high because of how codexSessionAliasBeats calls this function. It calls isCodexCurrentRollout twice per comparison. dedupeScannedSessions runs on every Codex row, and it runs twice per scan (after the parse and again in mergeSessions). In an unlimited scan with thousands of Codex rows, the scan makes thousands of blocking file reads plus TOML scans on the scanning thread, and every read returns the same result.

Memoize the home → sqliteHome mapping in the scan cache. One option is to key a second map by home.

♻️ Proposed fix
-export type CodexSelectionCache = Map<string, Map<string, string> | null>
+export type CodexSelectionCache = {
+  sqliteHomes: Map<string, string>
+  selections: Map<string, Map<string, string> | null>
+}
@@
-  const sqliteHome = resolveEffectiveCodexSqliteHome(home)
-  if (!cache) {
+  if (!cache) {
+    const sqliteHome = resolveEffectiveCodexSqliteHome(home)
     return readCodexThreadRolloutFileNames(sqliteHome, name.threadId)?.get(name.threadId) ?? null
   }
-  let selection = cache.get(sqliteHome)
+  let sqliteHome = cache.sqliteHomes.get(home)
+  if (sqliteHome === undefined) {
+    sqliteHome = resolveEffectiveCodexSqliteHome(home)
+    cache.sqliteHomes.set(home, sqliteHome)
+  }
+  let selection = cache.selections.get(sqliteHome)
   if (selection === undefined) {
     selection = readCodexThreadRolloutFileNames(sqliteHome)
-    cache.set(sqliteHome, selection)
+    cache.selections.set(sqliteHome, selection)
   }

Then initialize the cache in withCodexCurrentRolloutScan as { sqliteHomes: new Map(), selections: new Map() }.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c5574ab-ddb5-4369-a5f2-6725123d384f
📥 Commits

Reviewing files that changed from the base of the PR and between 907694d and ab08918.

📒 Files selected for processing: 43
  • src/main/ai-vault/codex-current-rollout.ts
  • src/main/ai-vault/codex-session-root-dedup.test.ts
  • src/main/ai-vault/codex-session-root-dedup.ts
  • src/main/ai-vault/session-parse-cache-database.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/ai-vault/session-scanner-codex-revert.test.ts
  • src/main/ai-vault/session-scanner-inherited-history.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/codex-accounts/codex-managed-home-lifecycle.ts
  • src/main/codex-accounts/runtime-home-service-managed-home.ts
  • src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-conversation-store.ts
  • src/main/codex/codex-current-rollout-selection.ts
  • src/main/codex/codex-minimum-version.test.ts
  • src/main/codex/codex-pinned-rollout-proof.test.ts
  • src/main/codex/codex-pinned-rollout-proof.ts
  • src/main/codex/codex-rollout-file-name.ts
  • src/main/codex/codex-rollout-lineage.ts
  • src/main/codex/codex-rollout-session-meta.ts
  • src/main/codex/codex-session-index-heal-state.ts
  • src/main/codex/codex-session-resume-home.ts
  • src/main/codex/codex-shared-store-config.ts
  • src/main/codex/codex-shared-store-migration.test.ts
  • src/main/codex/codex-shared-store-migration.ts
  • src/main/codex/codex-sqlite-home.ts
  • src/main/codex/codex-state-db.ts
  • src/main/codex/codex-structured-launch-resolution.test.ts
  • src/main/codex/codex-structured-launch-resolution.ts
  • src/main/codex/codex-structured-session-adapter.test.ts
  • src/main/codex/codex-structured-session-state.ts
  • src/main/codex/codex-structured-thread-open.test.ts
  • src/main/codex/codex-structured-thread-open.ts
  • src/main/codex/codex-structured-visuals.test.ts
  • src/main/native-chat/codex-transcript-lineage.ts
  • src/main/native-chat/session-file-id-layouts.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/transcript-reader.ts
  • src/main/native-chat/transcript-tail-reader.ts
  • src/main/preflight/codex-workspace-relative-path.test.ts
💤 Files with no reviewable changes: 4
  • src/main/codex/codex-pinned-rollout-proof.test.ts
  • src/main/codex/codex-structured-session-state.ts
  • src/main/codex/codex-structured-visuals.test.ts
  • src/main/codex/codex-pinned-rollout-proof.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment thread src/main/codex/codex-config-mirror.ts Resolved
@brennanb2025 brennanb2025 changed the title fix(codex): resume the same Codex conversation under every account, and list it once in History Codex conversations continue under every account Oct 28, 2026
@blacksmith-sh

This comment has been minimized.

@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: 9


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d4dd968-111f-47ee-b9fc-5b9f1459e605
Commits

Reviewing files that changed from the base of the PR and between 0d452c8 and 979fc66.

Files selected for processing: 63
  • config/flaky-test-pattern-baseline.txt
  • src/main/ai-vault/session-scanner-codex-paths.ts
  • src/main/ai-vault/session-scanner-codex-title-index.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/codex-accounts/codex-config-mirror.test.ts
  • src/main/codex-accounts/codex-config-mirror.ts
  • src/main/codex-accounts/codex-managed-home-lifecycle.ts
  • src/main/codex-accounts/guest-codex-account-homes.ts
  • src/main/codex-accounts/managed-codex-auth-readiness.ts
  • src/main/codex-accounts/runtime-home-catalog-probe-prep.test.ts
  • src/main/codex-accounts/runtime-home-managed-auth-recovery.test.ts
  • src/main/codex-accounts/runtime-home-mirror-login-copy.test.ts
  • src/main/codex-accounts/runtime-home-per-account-homes.test.ts
  • src/main/codex-accounts/runtime-home-read-only-launch-resolution.test.ts
  • src/main/codex-accounts/runtime-home-real-home-lane-routing.test.ts
  • src/main/codex-accounts/runtime-home-service-home-routing.ts
  • src/main/codex-accounts/runtime-home-service-launch.ts
  • src/main/codex-accounts/runtime-home-service-managed-home.ts
  • src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts
  • src/main/codex-accounts/runtime-home-service-state.ts
  • src/main/codex-accounts/runtime-home-system-resource-materialization.test.ts
  • src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts
  • src/main/codex-accounts/service-account-selection-and-removal.test.ts
  • src/main/codex-accounts/service-managed-home-removal-retries.test.ts
  • src/main/codex/codex-account-home-discovery.ts
  • src/main/codex/codex-account-session-bridge.test.ts
  • src/main/codex/codex-account-session-bridge.ts
  • src/main/codex/codex-account-session-index-heal.test.ts
  • src/main/codex/codex-account-session-index-heal.ts
  • src/main/codex/codex-ai-vault-session-resume.test.ts
  • src/main/codex/codex-ai-vault-session-resume.ts
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-launch-home.test.ts
  • src/main/codex/codex-launch-home.ts
  • src/main/codex/codex-legacy-session-resume.test.ts
  • src/main/codex/codex-legacy-session-resume.ts
  • src/main/codex/codex-pane-launch-account.ts
  • src/main/codex/codex-runtime-home-launch-preparation.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-session-bridge.ts
  • src/main/codex/codex-session-resume-home.ts
  • src/main/codex/codex-session-resume-launch-preparation.ts
  • src/main/codex/codex-session-source-home.ts
  • src/main/codex/codex-shared-store-config.ts
  • src/main/codex/codex-state-db.ts
  • src/main/codex/codex-structured-launch-resolution.ts
  • src/main/codex/config-toml-runtime-owned-sections.ts
  • src/main/ipc/pty/host-env/types.ts
  • src/main/native-chat/structured-conversation-key.ts
  • src/main/orcad/orcad-account-services.ts
  • src/main/orcad/orcad-codex-account-homes.test.ts
  • src/main/orcad/orcad-codex-account-homes.ts
  • src/main/runtime/construction/runtime-construction-dependencies.ts
  • src/main/runtime/structured-agent-account-home.ts
  • src/main/runtime/structured-agent-cli-writers.test.ts
  • src/main/runtime/structured-agent-runtime-metadata.ts
  • src/main/runtime/structured-agent-runtime-registration-types.ts
  • src/main/startup/codex-launch-preparation.ts
  • src/main/startup/main-process-account-services.ts
  • src/main/wsl/wsl-orcad-account-env.test.ts
  • src/main/wsl/wsl-orcad-account-env.ts
  • src/shared/account-runtime-capabilities.ts
  • src/shared/global-settings-types.ts
Files with no reviewable changes: 7
  • src/main/codex-accounts/runtime-home-system-resource-materialization.test.ts
  • src/main/codex/codex-session-bridge.test.ts
  • src/main/codex/codex-legacy-session-resume.test.ts
  • src/main/codex/codex-account-session-bridge.test.ts
  • src/main/codex/codex-account-session-index-heal.test.ts
  • src/main/startup/main-process-account-services.ts
  • src/main/codex/codex-account-session-index-heal.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +107 to +108
safeRemoveTree(join(managedHomePath, 'auth.json'))
safeRemoveTree(join(managedHomePath, 'auth.lock'))

@coderabbitai coderabbitai Bot Oct 28, 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.

Major · Security & Privacy · Quick win

Confirm credential deletion before completing account removal.

If an authentication file is locked, safeRemoveTree suppresses the unlink error. CodexAccountSelection.remove has already removed the account from settings, so auth.json can remain on disk without a reported cleanup failure. Retry transient failures and report a persistent failure instead of treating credential deletion as complete. (raw.githubusercontent.com)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed: the current selective remover can swallow a private auth unlink failure. This remains open for restoring bounded retries and the existing cleanup warning boundary while preserving conversation stores. Successful hook-authority revocation does not establish successful credential deletion.

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.

@brennanb2025 Agreed. The finding remains open. Credential deletion needs bounded retries and a warning on persistent failure, while preserving conversation stores. Successful hook-authority revocation is not proof that credential deletion succeeded.


✏️ Learnings added
Learnt from: brennanb2025
Repo: stablyai/orca PR: 30957
File: src/main/codex-accounts/codex-managed-home-lifecycle.ts:112-113
Timestamp: 2026-10-29T15:40:04.836Z
Learning: Within repository "stablyai/orca", only for files matching one of ["src/main/codex-accounts/codex-managed-home-lifecycle.ts"]: When reviewing host account removal in src/main/codex-accounts/codex-managed-home-lifecycle.ts, verify that selective credential cleanup uses bounded retries for transient deletion failures and reports persistent failures through the cleanup warning boundary while preserving conversation stores. Do not treat successful hook-authority revocation as proof of successful credential deletion.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

Comment thread src/main/codex/codex-launch-home.ts Resolved
Comment thread src/main/codex/codex-launch-home.ts Resolved
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 2/5

[Medium impact] The change reaches Codex account launches, resumes, and History on host systems.

The PR is not ready to merge because unreadable accounts can still block healthy resumes and hook updates, or hide account restart prompts.

Findings

  1. P1 One account blocks other resumes ▶
  2. P1 Unrelated accounts hide restart prompts ▶
  3. P1 Unreadable accounts block hook updates ▶

Summary

This PR separates Codex login folders from conversation storage so account changes can keep using the same conversation database and writer locks.

  • Codex conversations continue in one store while accounts keep separate logins.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Selected account login] --> C[Launch folder]
  B[Original conversation folder] --> C
  C --> D[Codex terminal or chat]
  D --> E[Shared conversation database and writer locks]
  B --> E
Loading

Reviews (4) · Last reviewed commit: "Align Codex home tests with preparation ..." · Reviewed by Greptile

Comment thread src/main/codex/codex-launch-home.ts Resolved
Comment thread src/main/codex/codex-launch-home.ts Resolved
Comment thread src/main/codex/codex-launch-home.ts Outdated
Comment on lines +141 to +142
if (verdict.kind === 'indeterminate') {
throw verdict.error

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 One account blocks other resumes

A permission or disk error reading one retired account’s ownership marker produces indeterminate. This throw then aborts discovery for every account, including healthy ones. getHostCodexHomePathsForSessionDiscovery propagates the error into resume preparation, and title reads also use this inventory.

Skip unreadable entries for the current inventory without treating them as deleted. Report their errors separately so unrelated conversations remain usable.

Knowledge Base Used: AI Vault sessions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the same outstanding permission-inventory failure described in #30957 (comment). Healthy offline-target restoration is covered, while unreadable account/root isolation remains pending. Keeping this thread open with that shared repair.

Comment on lines +149 to +150
if (owned.kind === 'indeterminate') {
throw owned.error

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Unrelated accounts hide restart prompts

If an earlier account’s files are unreadable, accountOwnsCodexHome throws inside .find() or .some() before reaching the healthy account that owns the launched pane. The outer catch returns null, so spawn publication forgets the pane’s account. Later account changes produce no restart prompt, even though the terminal still uses the previous account.

Continue checking other candidates when an unrelated account is unreadable, without guessing its ownership.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Modern host births now publish the final prepared account and actual home directly with the returned incarnation; both commit paths and qualified disk restart are covered by the targeted tests. The legacy candidate-search ownership-I/O case remains open, so this thread is not fully resolved by the modern publication change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed. The modern publication changes cover the paths you listed, but they don’t address the legacy candidate-search case: an ownership I/O error for one account can still abort the search before the owning account is reached. I’ll keep this finding open; the legacy search needs to continue past unreadable unrelated candidates without guessing ownership.

Comment on lines +105 to +110
resolveTrustedHome: (account) => {
const resolved = this.resolveSelfContainedManagedHome(account)
if (resolved.kind === 'indeterminate') {
throw new ManagedCodexHomeTemporarilyUnavailableError()
}
return resolved.kind === 'owned' ? resolved.homePath : null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Unreadable accounts block hook updates

When one account folder is unreadable, this callback throws while collectRetainedCodexHookTargets is still building the home list. The per-home error handler has not started yet, so startup and later retries abandon all healthy homes too. Retained terminals miss hook repairs, and opting out can leave their hooks installed.

Catch inventory errors per account or family, keep the healthy targets, and retry the failed entries separately.

Knowledge Base Used: Agent integrations and hooks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed from the collector source: an unreadable account can abort target collection before the per-target handler, preventing healthy retained-family repair and opt-out. The existing hook-file rename-failure fixture starts after collection and does not cover this input. The collector case remains unrepaired and this thread stays open.

Keep saved conversation identity independent of storage discovery, isolate retained-home observations, and settle healthy hook work during bounded retries. Preserve native stores while revoking account-private files.

Tracked in STA-11187.
Use fixture-only file auth so the healthy adoption proof reaches prepared-store recognition before real create and send settlement.

Tracked in STA-11187.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing: #42614 ("Keep one copy of Codex history shared by every account", merged 2026-11-16) replaces this. Each Codex session is now kept once and shared by every account.

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.

1 participant