Wire Claude structured sessions through agentSession.* - #13578
Closed
brennanb2025 wants to merge 5 commits into
Closed
brennanb2025 wants to merge 5 commits into
brennanb2025 wants to merge 5 commits into
Conversation
8 tasks
brennanb2025
force-pushed
the
brennanb2025/claude-structured-runtime
branch
2 times, most recently
from
August 10, 2026 11:04
20af702 to
0c0f356
Compare
brennanb2025
force-pushed
the
brennanb2025/claude-structured-runtime
branch
from
August 10, 2026 11:26
7fd839a to
0ee46a3
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude:(sessionId, uuid)where the provider supplies a message identity.agentSession.*RPC surface.Trace:
agentSession.createresolves a provider-aware attach intent, the shared host reserves and proves the lease through the routed adapter, Claude events enter the shared journal sink, and subscribers receive the same snapshot/batch protocol as Codex. During takeover, graceful close records the last observed Claude leaf at the new reservation fence before the launch resolver selects the resume head.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— 49,048 passed and 99 skipped; 5 environment-sensitive existing failures remain in the root-directory guard fixtures (3) and inherited Git-config expectations in relay agent-exec tests (2).pnpm buildagentSession.*integration coverage.mobile/pnpm lintmobile/pnpm typecheckmobile/pnpm test— 3,451 passed, 3 skipped.AI Review Report
Reviewed identity stability, final-snapshot replacement, tool row lifecycle, prompt CAS routing, cancellation tombstones, lease fencing, close/resume ordering, restart readability, router fallback behavior, and mixed-version wire behavior. The review found max-lines pressure in existing host/store modules and an adapter fallback regression; the implementation extracted narrow domain modules and restored the Codex-only fallback, with the affected suite passing afterward.
Cross-platform review covered macOS, Linux, and Windows paths and process seams, WSL/SSH refusal behavior, folder-workspace locations, runtime-only path resolution, and the absence of shortcut, label, shell-launch, or Electron UI changes. No new platform-specific command construction or native dependency was added.
Security Audit
The slice keeps the existing installed Claude CLI and managed
CLAUDE_CONFIG_DIRaccount lane; it adds no dependency, API-key flow, credential capture, or secret-bearing journal field. Provider payloads use the shared journal limits, mutations retain the shared fingerprint/ledger/fence admission path, and permission replies resolve only through the durable item-to-live-prompt binding.The subscription-auth policy remains parked and is not implemented around here: the runtime inherits the user CLI login established by the adapter stack, and API-key product policy requires a separate decision. Auth failures continue through the adapter refusal/diagnostic path without exposing credential values.
Notes
This is PR 2 stacked on #13569. PR 3 will add capability-gated, opt-in mobile Claude selection and option-picker wiring; Claude remains never-default until that client gate lands.
The stack was verified against the current
brennanb2025/codex-structured-mobile-writetip before opening. After the Codex stack lands, retarget #13569 to its landing branch first, then retarget this PR to the landed #13569 head so this diff remains translation/runtime/integration-only.