Repository navigation
feat: SDK control protocol for code.* and artifact_chat APIs - #8
Merged
Merged
Conversation
Phase 1 - Goal Budget System: - Goal state manager with priority queue and budget tracking - GoalCreateTool, GoalGetTool, GoalUpdateTool, GoalSetBudgetTool - Budget enforcer for turns/tokens/wall-time limits - /goal command (status, pause, resume, cancel, replace, next) Phase 2 - Undo/Rewind: - Undo engine with anchor detection and compaction boundary awareness - /rewind (alias /undo) command using setMessages for message truncation Phase 3 - D-Mail & Task Health: - D-Mail summary registration (registerDmailSummary, getDmailSummary) - Task health monitor with crash recovery and notification manager - /btw command for async D-Mail delivery Phase 4 - Approval & Context: - /approve-session command (grant, list, clear session-scoped permissions) - cancelBySource/approveForSession/denyForSession runtime API - Git context injection for researcher/reviewer/explorer agent types - Summary continuation hints for brief subagent output Crash bug fixes: - context.sessionId does not exist on ToolUseContext — replaced with getSessionId() from bootstrap/state.js in 7 files (GoalCreateTool, GoalGetTool, GoalSetBudgetTool, GoalUpdateTool, DMailTool, /goal command, /save-session command) - context.getMessages does not exist — rewound /rewind from 'local' to 'local-jsx' type, uses setMessages updater to read+truncate - context.setMessageSlice does not exist — replaced with setMessages slice approach in /rewind command - DMailTool redesigned from message-based checkpoint to summary-based registration (tools cannot access conversation messages) Co-Authored-By: Claude <[email protected]>
These analysis/docs are local-only working references, not part of the codebase. Added to .gitignore so they stay on disk but out of the repo. Co-Authored-By: Claude <[email protected]>
1. LOCAL_MODEL_BEHAVIORAL_PROMPT: When provider=fusionMlx, append a balanced behavioral prompt (~2.9K tokens) after the default system prompt. Covers reasoning, communication, coding, and reliability guidelines derived from the vendor-neutral Fable 5 system prompt. Only activates for local model provider — no impact on cloud models. 2. getChubHint(): Auto-detects chub CLI availability and injects a <context_hub_hint> into researcher/explorer/code-reviewer/general-purpose sub-agents, guiding them to use 'chub search/get' for up-to-date API documentation instead of relying on potentially stale knowledge. Related: fusion-mlx#218 (core.md injection on inference side) Related: analysis-prompt.md (integration plan) Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
- Add toMlxModelName() to convert / to -- for MLX server API calls - Add getOriginalFetch() to capture real fetch before SDK wrapping - Replace bare fetch() with getOriginalFetch() in retry path - Fix fusionMlxModel is not defined crash in cloud provider path - Pre-cache getMlxModelCapabilities before creating fetch interceptor - Remove all debug console.error logs from debugging session Both cloud (glm5.1 via LiteLLM) and local MLX providers verified working. Co-Authored-By: Claude <[email protected]>
…, #4, #5) - Add Zod schemas for code_exec, code_processes, code_kill, code_file_read, code_file_write, code_diff, code_apply_patch, code_search_files, artifact_chat in controlSchemas.ts - Register all new schemas in SDKControlRequestInnerSchema union - Implement handlers in print.ts dispatch chain: - code_exec: spawn with timeout, stdout/stderr capture - code_processes: stub (returns empty list) - code_kill: process.kill with configurable signal - code_file_read: readFile with offset/limit support - code_file_write: writeFile with mkdir -p option - code_diff: unified diff via 'diff' npm package - code_apply_patch: apply unified diff with .bak backup - code_search_files: spawnSync find/grep (no shell injection) - artifact_chat: JSON-RPC to artifact engine - Fix fusion-mlx-adapter: remove stale debug logs, fix bare fetch() in retry path to use getOriginalFetch() Co-Authored-By: Claude <[email protected]>
This was referenced Aug 20, 2026
This was referenced Aug 27, 2026
Merged
dahai80
added a commit
that referenced
this pull request
Aug 27, 2026
…2.2) (#161) ar-plan PR #8: build on the S2.1 shadow write (PR #160) with a pure projection + dev-only assertion that verifies the event stream is complete. - deriveMessages(log): Message[] — pure projection. Message-bearing events (user_message/assistant_message/tool_result) project to Message[]; arrays flatten. compact = boundary (truncate prior). turn_start/turn_end/ error skipped. seq-unordered input → ordered output. - assertDualWrite(log, mutableMessages, turnId) — dev + FUSION_CODE_EVENT_SOURCING only; prod early-returns byte-identical. deepStrictEqual derived vs mutable; drift → logForDebugging + throw (fail-visible in dev). Called once per turn-end (not per push) to bound cost. - QueryEngine: wire assertDualWrite before final yield (after capturing turnResultUuid — TDZ-safe: declare const first, then assert). Still no read-path switch — prod reads mutableMessages as before; projection is dev-assertion + unit-test only. Default-off + env gate preserves byte- identical-off (PR #7 NOOP_RECORDER pattern continues). Co-authored-by: Claude Fable 5 <[email protected]>
1 task done
dahai80
added a commit
that referenced
this pull request
Nov 30, 2026
Documents the #390 line: S1 first-task pass (13-run debugging chain compressed to one root cause per run), the external-mode architecture (host loop + FUSION_CODE_SHELL_PREFIX proxy + mirrored workdir), the 89-task network census and A20 freeze, and the ADAPT round-0 data path dry-validation (ft datasets from-eval: 19 SFT samples + sha256 manifest). A20 baseline section is PENDING until the exclusive engine window lands the run. Co-authored-by: Claude Code <[email protected]>
This was referenced Nov 30, 2026
Merged
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
Implements SDK control protocol endpoints for issues #3, #4, #5.
Issue #5 — Command Execution API
code_exec: Execute shell commands with cwd, timeout, stdout/stderr capturecode_processes: List running child processes (stub — returns empty for now)code_kill: Kill a process by PID with configurable signalIssue #4 — File Edit API
code_file_read: Read file with offset/limit, encoding supportcode_file_write: Write file with auto-mkdir optioncode_diff: Generate unified diff between two text contentscode_apply_patch: Apply unified diff patch with .bak backupcode_search_files: Search by content (grep) or filename (find) — uses spawnSync with arg arrays (no shell injection)Issue #3 — Artifact Chat API
artifact_chat: JSON-RPC call to artifact engine for AI-driven artifact generation/iterationChanges
src/entrypoints/sdk/controlSchemas.ts: Added 9 request schemas + 9 response schemas, all registered inSDKControlRequestInnerSchemaunionsrc/cli/print.ts: Added handler dispatch for all 9 subtypes in the control_request processing chainsrc/services/api/fusion-mlx-adapter.ts: Removed stale debug logs, fixed barefetch()in retry path to usegetOriginalFetch()Closes #3, Closes #4, Closes #5
🤖 Generated with Claude Code