Skip to content

Harness: correct the text layer for DreamCoder and non-Claude models #270

Open
1 of 10 issues completed
Open

Description

@GoDiao

Part of #261. A review of everything the model reads besides the conversation (system prompt, tool descriptions, context loaded at session start, text injected mid-session) compared DreamCoder with Codex CLI and ZCode and found 79 issues: system prompt, tools, context loading, mid-session text. Each finding has the current behavior with code locations, a concrete scenario, how the other two handle it, and a fix direction.

This issue covers the correctness part. Items that are self-contained and fully specified are split into sub-issues for contributors (listed at the end); the rest are done here. Shrinking the fixed part of each request and adding missing guidance wait for the benchmark task set and get their own issues later.

Decided

Context and memory

  • Saving a memory asks the user every time (T-CTX-02, T-SYS-05). The server sets CLAUDE_COWORK_MEMORY_PATH_OVERRIDE; the permission carve-out for memory files applies only without an override (src/utils/permissions/filesystem.ts:1739), so every write needs approval, even in bypass mode, while the memory instructions say to write directly. Extend the carve-out to the override path.
  • The skill list goes out of step with what the model knows (T-CTX-03, T-INJ-10). After compaction it is not sent again; any change in the skill directories resends the whole list; after a restart it is sent again in full. One record of sent skills drives all three.
  • The first user message contradicts itself (T-CTX-04). "May or may not be relevant" outside, "must follow exactly" inside, and MEMORY.md under the "must follow" preface.
  • Subagents get the memory index without the memory instructions (T-CTX-16).

CLI restarts

The desktop app restarts the CLI three seconds after Stop and whenever effort, model, provider or bypass mode changes.

  • Injected context is lost on restart (T-INJ-02). For non-ant users the transcript keeps only queued-message attachments (src/utils/sessionStorage.ts:4406-4423), so uploaded images and files, subdirectory instruction files and files restored after compaction disappear, and the prefix cache misses from the first dropped attachment. Write all attachments to the transcript.
  • Session-start context is computed per process (T-CTX-06). Git status, instruction files and date are recomputed after each restart; hook output and nested instruction files are appended again.
  • Stop always ends the CLI process (src/server/ws/handler.ts:875-881), without checking whether the interrupt already ended the turn. End it only when the turn did not stop.
  • Resuming inserts "Continue from where you left off." and a fake assistant reply, but does not continue (T-INJ-17).

Text for the model in use

  • Delete the internal-build-only text (T-SYS-03, T-TOOL-21). The USER_TYPE === 'ant' branches in the system prompt and tool descriptions never reach DreamCoder users; remove them instead of keeping dead text.
  • Reminders and messages that arrive after a tool result are appended to its text (T-INJ-12). A Claude-specific measure (src/utils/messages.ts:2698-2724) applied to every model; for other models keep them as separate blocks, which the proxy already sends as a separate user message. Check that the main providers accept a user message right after tool messages. Shorten the repeated authority notice in cross-session and kanban messages.
  • The environment section lists Claude models, Claude Code's products and /fast (T-SYS-04, T-CTX-05), and says nothing about the desktop app.
  • Read says the model can see images and read PDFs (T-TOOL-04), and calls itself "a multimodal LLM". Through the proxy, images in tool results and PDFs do not reach the model today; describe what actually reaches it.
  • /help points to Claude Code (T-SYS-10); the text about how output is shown does not match the desktop app (T-SYS-11); the update-config skill entry names Claude Code and a Config tool that is not sent (T-CTX-09); the statusline-setup subagent configures a status line the desktop app does not have (T-SYS-12).

Behavior the text gets wrong

  • Plan mode has three different procedures (T-TOOL-09); one says not to write any file, another asks for a plan file.
  • EnterWorktree and ExitWorktree describe hooks, tmux and an exit prompt the desktop app does not have (T-TOOL-13). Keep the tools; describe the desktop behavior and check that the desktop panels follow the CLI into the worktree.
  • AskUserQuestion exposes internal fields and a preview the desktop app does not render (T-TOOL-11).
  • The file-changed notice blames "the user or a linter", says not to tell the user, and carries up to 8K per file (T-INJ-06).
  • /goal continuation gives the model one sentence from the evaluator (T-INJ-07), without the goal text, budget or a continuation limit.
  • The compaction summary points to a JSONL transcript that is usually over Read's 256 KB limit (T-INJ-13).

Sub-issues for contributors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions