Skip to content

feat(daemon): stamp ACP command-identity digest on sessions - #2783

Merged
lsm merged 3 commits into
devfrom
space/acp-split-8b-digest
Aug 23, 2026
Merged

lsm merged 3 commits into
devfrom
space/acp-split-8b-digest

Conversation

@lsm

@lsm lsm commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

Extracted from #2711 (ACP split 8/10).

What this adds

  • SessionMetadata.acpCommandIdentity (shared types): stores a digest of the ACP launch command per session.
  • AcpQueryRunner stamps the digest at query start; when it differs from the persisted one and an ACP session id exists, the runner drops the persisted session/instructions/context estimate and starts a fresh conversation — switching the agent command (devin acp → claude-agent-acp …) no longer resumes a session created by a different agent. When there is no persisted session, it just stamps.
  • Only the digest is persisted — the raw command line never reaches session metadata.
  • getAcpCommandIdentityDigest loses its @public knip marker: the query runner is its consumer now.
  • 3 tests: identity change → fresh session (instructions re-sent), identity match → session preserved, digest-only persistence.

Notes

Verification

  • bun test tests/unit/lib/acp/acp-query-runner.test.ts — 47/47
  • knip, tsc --build --noEmit, oxlint, biome — clean
  • Full tests/unit/lib/acp/ failure set identical to the clean-dev sandbox baseline (pre-existing AcpClient/mock-server environment noise, none in files this PR touches)

Open in Devin Review

@lsm

lsm commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c42cf30c01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lsm

lsm commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@lsm

lsm commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

Codex P1 addressed in f03a303: the rotation no longer erases the persisted session id up front — the identity stamp and any id change persist together only when the replacement command establishes a session (or hits the post-establishment startup-timeout retry path). New regression test covers the failed-start case: no DB write touches acpSessionId or metadata.

@lsm

lsm commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f03a303e27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lsm added 3 commits August 23, 2026 02:15
Persist a digest of the ACP launch command in session metadata and
start a fresh ACP conversation when it changes, so switching the agent
command no longer resumes a session created by a different agent. Only
the digest is stored — the raw command line never reaches session
metadata.

Extracted from #2711 (ACP split 8/10).
…n exists

Keep the old persisted ACP session id until the replacement command
actually establishes a session, so a command change whose agent fails to
start can be reverted and the previous conversation resumed. The stamped
identity metadata now rides the first session-id persist instead of an
eager update that erased the resume handle up front.
@lsm
lsm force-pushed the space/acp-split-8b-digest branch from f03a303 to cc39f56 Compare August 23, 2026 06:15
@lsm
lsm merged commit df0ef29 into dev Aug 23, 2026
51 checks passed
@lsm
lsm deleted the space/acp-split-8b-digest branch August 23, 2026 06:23
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