Skip to content

fix(coding-agents): honor retainSessions in stop hooks - #3472

Open
altaywtf wants to merge 4 commits into
vectorize-io:mainfrom
uinaf:fix/coding-agents-stop-retain-toggle
Open

fix(coding-agents): honor retainSessions in stop hooks#3472
altaywtf wants to merge 4 commits into
vectorize-io:mainfrom
uinaf:fix/coding-agents-stop-retain-toggle

Conversation

@altaywtf

@altaywtf altaywtf commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Honor retainSessions: false in Stop-hook harnesses as persistent plugin harnesses already do. The fully resolved global, harness, and bank configuration is checked before daemon startup or API activity.

Risk

The default remains true; only explicit retention opt-outs change behavior.

Verification

  • 535 tests passed
  • package build passed
  • generated coding-agent docs match
  • changed TypeScript passes Prettier
  • rebase range-diff is patch-equivalent

Copilot AI lite review requested due to automatic review settings August 13, 2026 19:29

Copilot AI 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.

Pull request overview

This PR makes retainSessions: false consistently disable session transcript write-back for coding-agent Stop-hook harnesses (matching the existing persistent-plugin behavior), and documents/tests the unified contract.

Changes:

  • Gate Stop-hook retention on the fully resolved config’s retainSessions value (after harness/bank overrides, before daemon/client work).
  • Update integration docs/README to describe retainSessions as a cross-harness session write-back flag.
  • Add Stop-hook integration tests that exercise Codex and Cursor Stop hooks across global/harness/bank/daemon-mode cases.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
skills/hindsight-docs/references/sdks/integrations/coding-agents.md Updates reference docs to state retainSessions: false disables session write-back across hook + plugin harnesses.
hindsight-integrations/coding-agents/src/core/stop-hook-retention.test.ts Adds integration coverage to ensure Stop hooks do nothing when retainSessions is disabled, including daemon-mode early exit.
hindsight-integrations/coding-agents/src/core/retain-hook.ts Applies the retainSessions gate before daemon startup / API client creation in the Stop-hook retention path.
hindsight-integrations/coding-agents/src/core/config.ts Updates the retainSessions field comment to reflect the cross-harness contract.
hindsight-integrations/coding-agents/README.md Mirrors the updated retainSessions contract in the integration README reference table.
hindsight-docs/docs-integrations/coding-agents.md Mirrors the updated retainSessions contract in the docs site integration page.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@altaywtf
altaywtf force-pushed the fix/coding-agents-stop-retain-toggle branch from 8e77ab8 to bd271fe Compare August 15, 2026 12:48
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.

2 participants