Skip to content

fix: preserve explicit Claude profile homes during spawn - #1

Closed
dlgochan wants to merge 1 commit into
ColorC:feat/agent-launch-profilesfrom
dlgochan:fix/claude-custom-profile-home
Closed

dlgochan wants to merge 1 commit into
ColorC:feat/agent-launch-profilesfrom
dlgochan:fix/claude-custom-profile-home

Conversation

@dlgochan

@dlgochan dlgochan commented Oct 2, 2026 •

Copy link
Copy Markdown

ELI5

A Claude profile that points at an existing credential directory should launch with that directory. Currently, selecting a managed Claude account can replace the profile's directory during spawn preparation.

What Changed

This is a focused follow-up to stablyai/orca#18674, targeting its feature branch rather than creating a competing profile catalog.

  • Record whether the selected profile itself supplies a nonempty credential-home override, separately from inherited agent defaults and secondary-home resolution.
  • Skip managed Claude auth preparation for explicit profile homes in both desktop IPC and runtime-controller spawns.
  • Consume the new provenance markers before spawning the child, preserving the original launch environment for reuse.
  • Cover custom, args-only, inherited-home and plain launches through both spawn entry points, including repeated launches with the same environment.

Why

At the parent PR head, a custom profile with env.CLAUDE_CONFIG_DIR=/external/work can reach the child as the selected managed account's directory. Simply checking for a profile ID plus a home variable also changes args-only profiles when the home comes from agentDefaultEnv. Recording provenance while composing the profile distinguishes these cases without changing the existing secondary-home resolver or Codex account-selection checks.

Linked Issue

Related to stablyai/orca#2284; fixes the custom-home regression reported in this review comment. This does not close the broader feature request.

Visual Proof

N/A — authentication preflight and process environment handling only; no UI or interaction changes.

Testing

  • Manually tested with real Claude accounts and native desktop processes.
  • Automated regression tests added.

Linux Docker with synthetic HOME and mocked PTY/auth boundaries: 55 tests passed across 3 files:

pnpm test src/main/ipc/pty-spawn-env-terminal-basics.test.ts \
  src/shared/agent-launch-profile/agent-launch-profile.test.ts \
  src/main/agent-launch-profile/launch-profile-home.test.ts

The explicit-home regression failed before the candidate fix; desktop and runtime inherited-home cases also failed before the provenance correction. Changed-code quality reports zero new findings; git diff --check passes. Node, web and CLI TypeScript checks pass.

Full application build, full test suite, native macOS/Windows, SSH integration and real OAuth refresh have not been exercised for this patch. The tests prove spawn preparation and environment preservation, not complete account isolation across every authentication layer.

The fork's track-community-pr workflow fails while creating the upstream bufo-bot token because its private-key input is empty. It does not execute code checks; the local results above are independent of that repository-secret configuration.

AI Disclosure

Implemented and reviewed with OpenAI Codex. A separate Codex review found the inherited-default-home case, which is covered by the regression tests. No human review is claimed.

Review

Please focus on the profile provenance boundary and parity between the two spawn entry points. The parent branch can adopt this commit or request adjustments; this draft carries only the complementary fix.

Agent skill upstream boundary

  • Not applicable: no skill installer source or assets are changed.

Notes

The environment metadata uses existing string-map transport and does not add a protocol opcode or settings field. Older code does not gain this fix merely by receiving the marker; the executing host must include the preflight change. Existing built-in home markers and profile attribution remain intact. No real credentials or installed Orca state were used in testing.

Checklist

  • Small and focused change with issue linkage and explanation.
  • Visual proof marked N/A with reason.
  • Self-review and separate agent review completed.
  • Cross-platform, SSH/remote and compatibility impact considered.
  • Full lint, typecheck, test suite and build pass; see the specific verification and limits above.

@dlgochan

dlgochan commented Oct 3, 2026

Copy link
Copy Markdown
Author

Closing this draft as I am moving the broader contribution to a branch based directly on stablyai/orca main. The focused regression and commit remain available here for reference; this is not waiting on action from this branch author.

@dlgochan dlgochan closed this Oct 3, 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.

1 participant