Repository navigation
fix(mod, opencode): name a review by what the CLI opened, not the typed words - #1737
Merged
Merged
Conversation
…ed words /plannotator-annotate . a.md opens a.md alone (the CLI's shared selection drops the stray '.'), but the mod named the session from the typed words: the command reply, status line and decision heading said '2 files: ., a.md' while the Target line was right. - Shared contract (copied into the mod): plannotatorTargetSubject(kind, target) names annotate/review from the target the CLI reports (file name, URL host, bundle file names, PR #N / MR !N, changes in <dir>). - Mod: when the ready line carries the target, the launch's base subject is derived from it; an older CLI that reports nothing keeps the typed-words subject. A review typed with no words stays 'local changes'. - OpenCode 2: the launch registry does the same on onServer, and a tool bundle's Files: line uses the CLI's resolved paths, like the slash command's (names in subjects, full paths in Target/Files lines). - Pi already names sessions from its own resolved paths; unchanged.
1 task
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.
Problem
/plannotator-annotate . a.mdopens only a.md (the CLI's shared selection drops the stray.), but the Claude Code mod built the subject from the typed words, so the command reply, status line and decision heading said "2 files: ., a.md". The Target line was already right.Fix
packages/shared/plannotator-tool.ts, pasted intoapps/hook/hooks/mod/tool.ts):plannotatorTargetSubject(kind, target)names annotate and review sessions from the target the CLI reports. It gives the basename for one file, a URL's host, "N files: a, b" for a bundle,PR #N/MR !N, orchanges in <dir>.plannotatorDistinctSubjects. An older CLI that reports no target keeps the typed-words subject. A review typed with no words stays "local changes". Plan and last keep their subjects.OpenCodeLaunchRegistryapplies the same rule inonServer. A tool bundle'sFiles:line now uses the CLI's resolved absolute paths, as the slash command's already did. Subjects carry names; full paths appear only in Target and Files lines.absolutePath,bundleFiles, the resolved review directory).Tests
targets.test.ts):. a.mdgives subjecta.mdin the reply, status line and heading. A bundle typed with prose words lists only the real files. Review prose is named by the reviewed directory, and no words gives "local changes". The tool bundle carries names in the subject and paths in Targets. An older CLI falls back to the typed words. The first three fail without the fix.plannotator-tool.test.ts, stub CLI): the slash command. notes.mdis namednotes.mdwith a full Target line. The tool bundle's Files line carries full paths. Both fail without the fix.plannotatorTargetSubject.Ran: mod bun tests (140 pass), OpenCode plugin + shared tool tests, Pi extension tests (436 pass),
bun run typecheck, and the mod engine harness (scripts/test-claude-code-mod.sh, 17 pass) with a tempCLAUDE_CONFIG_DIR.