feat(core,cli): M3c — compaction + statusLine + CLI flag wiring#11
Merged
Conversation
What ships
----------
- packages/core/src/compaction/index.ts
compact(history, {provider, keepFirstPairs, keepLastMessages, summarizerModel,
summaryMaxTokens}) → CompactionResult{history, messagesRemoved, usage,
summaryText}. Strategy: anchor head + summarized middle + recent tail.
shouldCompact({inputTokens, outputTokens, contextWindow, threshold}) helper.
- packages/core/src/harness/statusline.ts
StatusLineRunner — periodic exec with JSON-on-stdin payload (session_id,
model, cwd, mode, effort, transcript_path, cost, version, output_style).
Respects DEEPCODE_STATUS_LINE_DEBOUNCE_MS env override. 200-char output cap.
2s command timeout. Suppress EPIPE for scripts that don't read stdin.
Only fires onUpdate when stdout actually changes.
runStatusLineCommand standalone helper for one-shot use.
- apps/cli/src/repl.ts — wire CLI args into agent loop:
· systemPromptOverride / appendSystemPrompt / appendSystemPromptFile
· allowedTools / disallowedTools (filter BUILTIN_TOOLS before ToolRegistry)
· maxTurns
- apps/cli/src/cli.ts — pass parsed flags into startRepl
Tests (16 new, 281 total)
-------------------------
- compaction/index.test.ts (8): short-history-unchanged, compact-middle,
preserve-anchor + tail, summarizerModel override, usage reporting,
tool_use/tool_result rendering in summary prompt, shouldCompact threshold
- harness/statusline.test.ts (8): trimmed stdout, stdin payload, 200-char cap,
timeout → empty, exit-nonzero → empty, empty config → empty, Runner only
fires onUpdate when text changes, env-var debounce override
Verified
--------
pnpm typecheck → green
pnpm test → 240 + 41 = 281 passed / 0 failed
pnpm format:check → conformant
Deferred to next M3c PR
-----------------------
- Auto compaction trigger inside agent loop (wire shouldCompact post-turn)
- StatusLine actual REPL rendering
- /init multi-phase, auto classifier, remaining 4 hook handler types
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oratis
added a commit
that referenced
this pull request
Jun 1, 2026
…esize (#11) (#145) * feat(desktop): right-side file panel — Source/Diff/History + tabs + resize (#11) Implements the §3.11 file panel (Mac client). Inserts a 4th grid column between the chat stream and the 48px inspector rail (the inspector stays a rail while a file is open). - FilePanel.tsx — pure presentational component: multi-file tab bar (close ×, unsaved yellow dot), Source/Diff/History view switcher, Source (line-numbered read-only), Diff (inline +/- and side-by-side split, ⌘\ toggles), History (session version timeline), and a left-edge resize grip. - file-panel-reducer.ts (+ 9 unit tests) — pure tab/view/width state machine. - use-file-panel.ts — wraps the reducer with file reads (tool_read), width persistence (localStorage, 320–800px), and the ⌘O / ⌘[ / ⌘] keybindings. - App.tsx — renders the panel + the .file-open grid track, the resize drag, and makes ⌘\ context-sensitive (diff split/inline when a diff is showing, else the inspector toggle). Inspector "Recent files" rows now open into the panel. - tauri-api.ts — toolRead() wrapper over the unscoped tool_read command. Verified visually via a dev-only vite preview harness (src/preview.html, not in the prod bundle) screenshotted across all three views. Diff/History render from data the parent supplies; the snapshot-backed wiring (so Edit/Write populate them) + the click-a-file-in-chat trigger land in a follow-up — honest empty states meanwhile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(desktop): file panel must not flex-shrink below its dragged width flex-shrink: 0 so the panel keeps its set width (320–800px) in any flex context; the real app's grid `auto` track already sizes to it, this also makes the standalone preview harness respect the width. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <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.
Summary
compact(history, ...)— folds middle messages into summary while keeping anchor + tailStatusLineRunner— periodic exec with JSON-on-stdin contract, 200-char cap, env-var debounce--system-prompt/--append-system-prompt/--allowedTools/--disallowedTools/--max-turnsnow actually take effectRelease notes
release-notes:featureCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com