fix(coding-agents): honor retainSessions in stop hooks - #3472
Open
altaywtf wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
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
retainSessionsvalue (after harness/bank overrides, before daemon/client work). - Update integration docs/README to describe
retainSessionsas 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
force-pushed
the
fix/coding-agents-stop-retain-toggle
branch
from
August 15, 2026 12:48
8e77ab8 to
bd271fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Honor
retainSessions: falsein 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