sync(plugin): retime the mid-session offer and make declining recoverable (v1.17.0) - #32
Open
darrenzhu wants to merge 1 commit into
Open
sync(plugin): retime the mid-session offer and make declining recoverable (v1.17.0)#32darrenzhu wants to merge 1 commit into
darrenzhu wants to merge 1 commit into
Conversation
…able (v1.17.0) Propagates forge-mcp's plugin/ at 3eeeae60. Five hooks, one of them new. The mid-session tracking offer used to become eligible at the end of the very first turn, before anything was known about the session, so it read as onboarding noise — and dismissal was terminal, which meant one reflexive decline disabled tracking for the rest of the session, including at the moment it would have helped. Those were one failure, not two. - The offer now waits for real signal: 4 turns, 5 minutes of active work, or a commit. Where the session log cannot be read it degrades to turns only, never wall-clock. - Declining is graded. "Not now" comes back later and the returning offer acknowledges the earlier decline; only an explicit opt-out is terminal. - The git-milestone read moves into its own module, hooks/git-head.cjs. It follows the gitdir: pointer so worktrees resolve to their own HEAD rather than the main checkout's, walks up from subdirectories to the enclosing checkout, and stops at the home directory so a dotfiles repo is never mistaken for the project. - The baseline is seeded on the first prompt, so a commit made during the first turn counts instead of becoming its own baseline. - The offer's copy reads as prose — "going for 1 turn", not "1 turns". Source verified green before syncing: 8072 tests pass, 0 fail. Localized files were left alone: token-usage.cjs, workflow-guard.cjs, hooks.json and the SKILL.md files are untouched in every target. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Syncs
plugin/fromforge-mcpat3eeeae60(branchclaude/shi-905-implementation-plan-a2377d). v1.16.0 → v1.17.0.What changed for users
The mid-session tracking offer used to become eligible at the end of the very first turn, before anything was known about the session — so it read as onboarding noise. And dismissal was terminal, so one reflexive decline disabled tracking for the rest of the session, including at the moment it would actually have helped. Those were one failure mode, not two.
Files
Five hooks, one of them new:
git-head.cjsprompt-router.cjssession-state.cjsstop-observer.cjsworkflow-tracker.cjsgit-head.cjsis a required module (require('./git-head.cjs')), not an event hook — nohooks.jsonwiring needed.The worktree case
The milestone read follows the
gitdir:pointer rather than reading.git/HEAD. Inside a worktree.gitis a file, and the main checkout'sHEADnames a different branch — so a naive read returns the wrong branch, not no branch. It also walks up from subdirectories to the enclosing checkout, and stops at the home directory so a dotfiles repo is never adopted as the project.What was deliberately not touched
token-usage.cjs,workflow-guard.cjs,hooks.jsonand theSKILL.mdfiles carry per-platform localizations and are unchanged. Only the five hooks above and the version were synced.Where a synced hook had comment-only drift from the canonical source (reflows and near-synonyms — no functional difference), it was normalized to source. Diffs were checked against
git diff --numstatto confirm every change is proportional and no line endings flipped.Verification
Source suite green before syncing: 8072 pass, 0 fail. Each target's modules load clean.
🤖 Generated with Claude Code