Skip to content

feat(core): M3c-rest — TodoWrite + WebFetch + WebSearch tools#17

Merged
oratis merged 1 commit into
mainfrom
feat/m3c-rest-tools
May 28, 2026
Merged

feat(core): M3c-rest — TodoWrite + WebFetch + WebSearch tools#17
oratis merged 1 commit into
mainfrom
feat/m3c-rest-tools

Conversation

@oratis

@oratis oratis commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Three Claude-Code-parity tools, all registered in BUILTIN_TOOLS so they're available to every agent run by default (subject to --allowedTools / mode / permissions).

  • TodoWrite — agent submits the full desired state of its todo list; we validate (at most one in_progress) and persist to <sessionDir>/todos.json. New readTodos(sessionDir) helper for UI.
  • WebFetch — GET-only, 5 MiB cap (configurable via DEEPCODE_WEBFETCH_MAX_BYTES), AbortSignal honored, streaming byte-cap so a server that omits content-length can't blow memory.
  • WebSearch — DuckDuckGo HTML by default; pluggable via DEEPCODE_WEBSEARCH_URL_TEMPLATE for self-hosted SearXNG. Tolerant HTML parser with unit tests against stubbed markup.

Test plan

  • pnpm -F @deepcode/core test293 passed / 8 skipped (was 272 → +21 new tests across the 3 new tool test files)
  • pnpm -F @deepcode/core build — clean
  • pnpm -F deepcode-cli test — 41 unchanged (BUILTIN_TOOLS now includes the 3 new entries; CLI filtering still works)
  • BEHAVIOR_PARITY.md — Tools rows for these three move from 🔄 to ✅

Behavior notes

  • TodoWrite gracefully no-ops persistence when sessionDir is undefined (still validates input).
  • WebFetch returns body even on 5xx (with isError: true) so the model can see error pages.
  • WebSearch returns a friendly "No results" message when the parser finds nothing — not an error.

🤖 Generated with Claude Code

Three Claude-Code-parity tools shipped, all registered in BUILTIN_TOOLS.

  · TodoWrite — agent-managed task list, persisted to <sessionDir>/todos.json.
    Validates `at most one in_progress`. readTodos() helper for UI.
  · WebFetch — GET-only, 5 MiB cap (configurable via
    DEEPCODE_WEBFETCH_MAX_BYTES), AbortSignal honored, streaming byte-cap so a
    server that omits content-length can't blow memory.
  · WebSearch — DuckDuckGo HTML by default; pluggable via
    DEEPCODE_WEBSEARCH_URL_TEMPLATE for self-hosted SearXNG. Tolerant parser
    with unit tests against stubbed HTML.

Tests: +21 in core (293/8 pass/skip), 41 in cli unchanged.
BEHAVIOR_PARITY.md updated — these three move from 🔄 to ✅.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit 96ea11a into main May 28, 2026
1 of 2 checks passed
@oratis oratis deleted the feat/m3c-rest-tools branch May 28, 2026 05:11
oratis added a commit that referenced this pull request May 28, 2026
This session ("继续推进" from v2) added 5 PRs on top of #1-#16:
  · #17 M3c-rest tools (TodoWrite + WebFetch + WebSearch)
  · #18 M3.5 attack tests + security-model.md
  · #19 M8 headless mode (-p / --print)
  · #20 M5.2 plugin live wire-up
  · #21 system-reminder injector

Test count: 313 → 387 (+74).
Scope completion estimate: 65-70% → 72-78%.

Major remaining items: M6 Mac Electron (still 0%), M7 file panel (depends
on M6), and the M3c-rest/M8/M5.2 leftovers itemized in the body.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant