Skip to content

fix(session): recreate query when configured skills change - #968

Open
ran411285752 wants to merge 2 commits into
agentclientprotocol:mainfrom
ran411285752:fix/955-skills-session-fingerprint
Open

fix(session): recreate query when configured skills change#968
ran411285752 wants to merge 2 commits into
agentclientprotocol:mainfrom
ran411285752:fix/955-skills-session-fingerprint

Conversation

@ran411285752

Copy link
Copy Markdown
Contributor

Summary

  • include normalized Claude SDK skills in the resumed-session fingerprint
  • preserve the distinct semantics of omitted, 'all', empty, and explicit skill selections
  • avoid unnecessary Query recreation for reordered or duplicate skill names
  • keep unrelated _meta.claudeCode.options fields out of the fingerprint
  • recreate the Query with the same native session ID when skills change

Testing

  • npm run build
  • npm run lint
  • npx prettier --check src/acp-agent.ts src/tests/acp-agent.test.ts src/tests/create-session-options.test.ts
  • targeted lifecycle tests: 381 passed, 9 skipped
  • full test suite: 699 passed, 20 skipped
  • successful lifecycle case: newSession(['pdf']) -> resumeSession(['docx'])

Closes #955

Why: Resumed sessions reused a Query created with stale skills.
What: Normalize and fingerprint skills while preserving SDK semantics; add lifecycle regressions.
Impact: Skill changes now recreate the Query under the same session ID without fingerprinting unrelated options.
Refs: agentclientprotocol#955
Why: The lifecycle regression only proved teardown and a recreation attempt.
What: Exercise newSession through resumeSession and assert the SDK receives the replacement skills.
Impact: The PR now covers a successful Query replacement while preserving the native session ID.
Refs: agentclientprotocol#955
@ran411285752

ran411285752 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@benbrandt, could you review this when you have a chance? This extends the resumed-session fingerprint logic you introduced in #515 to include normalized Claude SDK skills, so changed skill selections recreate the Query while preserving the native session ID. The PR includes lifecycle coverage for omitted, 'all', empty, reordered/duplicated, and explicit skill selections, plus the successful newSession(['pdf']) -> resumeSession(['docx']) path.

The CI and Conventional PRs workflows are currently awaiting maintainer approval for this external-fork contribution. Thanks.

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.

Recreate resumed sessions when configured skills change

1 participant