Skip to content

fix(pi-arc): bind Arc commands to the current Pi session - #15

Merged
bfirestone merged 3 commits into
mainfrom
fix/arc-runtime-session-binding
Sep 6, 2026
Merged

bfirestone merged 3 commits into
mainfrom
fix/arc-runtime-session-binding

Conversation

@bfirestone

@bfirestone bfirestone commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

The Arc extension sent session-start data without session_id, and subprocess commands could inherit another session's identity.

Bind each invocation to the current Pi session manager. Register canonical session_id, cwd, and transcript_path using one captured identity; reject an empty identity before spawning; use invocation-scoped ARC_SESSION_ID for ordinary commands and explicit --session-id for prime. Preserve caller-supplied flags and clear stale cached prime context after a failed refresh.

Packaged claim and manual prime commands now pass guarded, quoted PI_SESSION_ID. Update source adaptation so Claude's binding becomes Pi's binding during migration, while preserving existing Pi workflows.

Validation: npm run check passed independently on f36afd7, including 81 pi-arc tests, other workspace tests/type checks, and package dry runs. Subprocess tests cover registration payloads, inherited identity conflicts, session switches, in-memory sessions, empty identity, caller flags, and shell-sensitive packaged command arguments. Targeted synthetic source adaptation tests pass.

Full regeneration against the current Claude source has pre-existing unrelated migration-overlay drift; this fix preserves the existing generated workflows and changes only session bindings. Full-sync repair is tracked as arc-0d80.023jby.

Requires the CLI interface in SentioLabs/arc#81; registration companion SentioLabs/arc#82. Tracks arc-0d80.051c29 and the earlier arc-0d80.01f3ua work.

Independent final acceptance: 15 packaged command checks across Claude/Codex/Pi and 15 Pi subprocess checks passed. The command-generation regression was also validated by deleting only its identity transform in a disposable copy and observing the expected failure.

@bfirestone
bfirestone marked this pull request as ready for review September 6, 2026 04:42
@bfirestone
bfirestone merged commit 7d9ed65 into main Sep 6, 2026
1 check passed
@bfirestone
bfirestone deleted the fix/arc-runtime-session-binding branch September 6, 2026 04:42
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