Repository navigation
fix(plugins): skip the slash-command caveat and echoes when picking the session goal - #2092
akx-vishnu wants to merge 4 commits into
Conversation
…he session goal The working-memory bookmark took the first user row of the transcript as the session's goal. A session that starts with a local slash command such as /clear begins with the client's isMeta caveat row and the command's echo, so the bookmark recorded the caveat as the goal and the next session's primer showed it. firstUserPrompt now skips isMeta rows, the echo of a command run with no arguments, and local-command output. A command with arguments is a request and still stands as the goal. Both plugins move to 1.2.163. Closes ClickHouse#2075 Signed-off-by: akx-vishnu <akx-vishnu@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 9401e50. Configure here.
Claude Code writes a local command's echo with <command-message> first in some versions, so those echoes still became the session goal. Signed-off-by: akx-vishnu <akx-vishnu@users.noreply.github.com>
zlareb1
left a comment
There was a problem hiding this comment.
No blocking findings. The parser skips caveats, local output and both tag orders for argument-free command echoes. Commands with arguments and the journal fallback keep their existing behavior. The plugin copies match. The focused Node suites passed 35 tests with one skip.
zlareb1
left a comment
There was a problem hiding this comment.
The Node tests pass. The format job found two lines in the added fixture that the pinned Biome formatter rejects.
…tures Signed-off-by: akx-vishnu <akx-vishnu@users.noreply.github.com>
|
Thanks, fixed in 138b99f: I applied |
zlareb1
left a comment
There was a problem hiding this comment.
The fixture passes Biome 2.5.14. The working-memory tests verify that both echo formats are skipped, a command with arguments is kept, and the bookmark falls back to its journal when no prompt remains. Both plugin copies match.
zlareb1
left a comment
There was a problem hiding this comment.
GitHub reports a merge conflict with main in both plugin manifests. Please reconcile the version bumps and keep the manifests in sync.
…al-2075 Signed-off-by: akx-vishnu <akx-vishnu@users.noreply.github.com> # Conflicts: # integrations/claude-code-plugin/.claude-plugin/plugin.json # integrations/codex-plugin/.codex-plugin/plugin.json
|
Reconciled in 4b2587c: I merged |
|
Correction to my last comment: of the recent open PRs, 1.2.163 and 1.2.167 are in use (not the whole 163–167 range). 1.2.168 is above both. |
zlareb1
left a comment
There was a problem hiding this comment.
Both plugin copies select the first typed request after a local-command caveat, echo, or output. The focused suite passed 15 tests, with one Windows-only case skipped. Both manifests agree on version 1.2.168.
zlareb1
left a comment
There was a problem hiding this comment.
The pinned Biome check rejects the same dashboard assertion on this merge and on main. The separate repair formats that assertion. Failed job · Repair #2107
zlareb1
left a comment
There was a problem hiding this comment.
The prepared-bot test fails at first-cell automation on this head and on clean main under Postgres 16. The repair waits for the first web process to enforce tenancy before provisioning the bot. Failed job · Repair #2106
|
@akx-vishnu plz fix merge conflicts |

Closes: #2075
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The Claude Code and Codex plugins' working-memory bookmark records the first request you typed as the session's goal, not the caveat Claude Code injects when a session starts with a local slash command such as
/clearor/model.Why
firstUserPrompt(integrations/claude-code-plugin/lib/working-memory.mjs) returned the firstuserrow that was not a sidechain or a tool result. A session that starts with a local command begins with the client'sisMetacaveat row, then the command's echo (<command-name>/clear</command-name>…<command-args></command-args>), then the request. Sogoal:held the caveat, or the/clearecho once the caveat was gone, and the next session's primer showed it as the work to resume.Scope and risk
firstUserPromptnow skipsisMetarows, assession-brief.mjsandtest-gate.mjsalready do. It also skips the echo of a command run with no arguments (<command-name>with empty or missing<command-args>) and local-command output (<local-command-stdout>,-stderr,-caveat)./<skill> <args>) is a request and still stands as the goal, in its raw form."", so the caller falls back to the turn journal as before.python -m scripts.codegen.agent_plugin_sync. Both plugin manifests move to 1.2.168:mainis at 1.2.162, and other open PRs use 1.2.163 and 1.2.167.Compatibility, rollout and rollback
Tests
tests/working-memory.test.mjswith the rows from the issue's repro: caveat +/clearecho + request, echo + request, the same plus<local-command-stdout>, only client rows (""), and a command with arguments kept as the goal.node --test integrations/claude-code-plugin/tests/working-memory.test.mjs: 16 passed."fix the failing search test"twice.session-brief.test.mjs, which also imports this module, passes.node --checkpasses on both copies.record-hook.test.mjsandsession-start.test.mjstime out, andtests/unit/test_codex_plugin.py::test_install_codex_dry_run_runs_nothing_and_capture_writes_loom_configfails. Cleanmaingives the same results on this machine, so I left those to CI on Linux.AI assistance in the code (leave one; writing this description with AI is fine):
session-brief.mjs/test-gate.mjs, read the diff, and ran the tests above.Note
Low Risk
Localized transcript filtering for session bookmarks; no API or persistence schema changes.
Overview
Fixes session goal picking when a Claude Code session starts with a bare local slash command (
/clear,/model). Working-memory’sfirstUserPromptnow ignores client-injectedisMetarows, empty-argument command echoes (<command-name>… empty<command-args>), and<local-command-*>output—same skip ideas assession-brief.mjsandtest-gate.mjs. Slash commands with arguments still count as the goal. If nothing remains, the hook still falls back to the turn journal viagoal: firstUserPrompt(objs) || firstUser(journal).The same logic is synced to the Codex plugin; both manifests bump to 1.2.168. New unit tests cover caveat + echo + real request, stdout-only noise, and argument-bearing commands.
Reviewed by Cursor Bugbot for commit 4b2587c. Bugbot is set up for automated code reviews on this repo. Configure here.