fix: wire Claude /context and /compact through to the Agent SDK#905
Open
xukaaaa wants to merge 1 commit into
Open
fix: wire Claude /context and /compact through to the Agent SDK#905xukaaaa wants to merge 1 commit into
xukaaaa wants to merge 1 commit into
Conversation
Strip the wrapped prompt so the SDK recognises the root command, and surface the compact lifecycle as system notices. Supersedes the /compact suppression from dohooo#898.
|
@xukaaaa is attempting to deploy a commit to the Caspian's Team Team on Vercel. A member of the Team first needs to authorize it. |
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
Claude
/contextand/compactwere silent no-ops. Helmor wraps every user prompt as{helmor preamble}\n\nUser request:\n{prompt}(Rust) plus a[Linked directories…]block (sidecar), so the Agent SDK never received a bare root slash command and treated/compact//contextas literal text./compactwas also suppressed in the composer as a "dead command" (#898).Fix
session-manager.ts—normalizeRootSlashCommandstrips the wrapping (via theUser request:marker) and returns the bare command the SDK needs (/compact,/context all); normal prompts keep the linked-dirs hint.compact-filter.ts(new) — drop the redundant synthetic## Context Usageassistant reply after/compact(kept for/context, whose output is useful).container.tsx— stop suppressing the SDK-reported/compactfor Claude (now wired through). Supersedes the/compactsuppression from Hide inert slash commands #898.status:"compacting"+compact_boundaryinto one system turn;event_filterlets the compacting status through; adapter rendersCompacting context/Context compactednotices.system-message.tsx— spinner while compacting, check icon when compacted.catalog.rs— claude custom-provider models reportsupports_context_usage: true.Tests (TDD, red-first)
sidecar/src/claude/compact-filter.test.ts,session-manager.test.ts(incl. wrapped-prompt root-cause case)system-message.test.tsx(spinner/check),container.test.tsx(suppress->show /compact)pipeline_streamscompact-boundary snapshot updatedclippy
-D warnings, fmt, typecheck, biome clean.cargo test --tests1555 pass. Manually verified inbun run dev: /compact triggers compaction lifecycle notices, /context shows usage, /compact appears in the slash popup.