feat: thinking, limits, compaction, skills, tool consent, tool search, subagents, attachments, VFS, token efficiency (0.0.20) - #18
Merged
Conversation
…search, subagents Agent loop: - thinking / stageThinking: portable reasoning level or exact budget, streamed thoughts (step/final.reasoning-delta), reasoning tokens in usage - limits: run caps for input / output / reasoning / total tokens (checked between steps and at every tool round) + per-call output caps; maxToolCalls, maxPlanSteps; budget.exceeded event, the run still answers - context: step results and tool findings now reach later steps and the synthesizer; auto + manual compaction (history, run trace) and a model-facing tool-output cap; agent.compact() - prompt caching: run-stable system prompts, Anthropic cache breakpoints, OpenAI promptCacheKey; cached tokens in usage - skills: SKILL.md parsing/loading, planner selection, load_skill / read_skill_file - tool consent: autopilot / ask-writes / ask-all / read-only, glob rules, "always allow", live setToolApprovalMode(); gate inside execute so native, prompted, MCP and subagent host-tool calls are all covered - large catalogues: 'search' / 'auto' tool selection with find_tools, condensed planner catalogue, schema-derived hints for prompted catalogues - subagents: createSubagentTool (in-process or Web Worker) + serveSubagentWorker, proxied host tools under the parent's gate - autonomy: prompts never ask the user; data questions are planned as tool work - native tool loop counts the usage of every step (was the last step only) MCP connector: paginated tools/list, per-server connectTimeoutMs, readOnlyHint → read-only tools. Deps: ai 7.0.127, @modelcontextprotocol/sdk 1.32.0, @ai-sdk/* and @browser-ai/* latest, typescript 6 (ignoreDeprecations for tsup's dts). Docs: docs/capabilities.md, README, design.md, tasks.md, CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
…le system
- run(goal, { images }) sends images to the planner, executor and
synthesizer as image parts; agent.capabilities.images / supportsImages()
/ `vision` decide whether a model can take them
- a text-only or prompted-mode model ends an image run at once (no tokens)
with ImagesNotSupportedError's message; a provider refusal of image input
is turned into the same clear error instead of a raw API error
- memory keeps a text note of attached images, never their bytes
- VirtualFileSystem: an IndexedDB (or in-memory) workspace with namespaces,
data-URL helpers and change events; IndexedDB schema v2 adds a `files`
store (v1 databases upgrade in place)
- createFileTools: fs_list / fs_read (read-only) and fs_write / fs_delete
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
run(goal, { files }) alongside images: PDFs and other files go to the model
as file parts, http(s) URLs as links (providers that accept links fetch them,
the SDK downloads for the rest). Images use v7 file parts too (the image part
is deprecated). agent.capabilities reports images / pdf / files; `inputs`
overrides per kind. A kind the model is known not to take ends the run before
any call with AttachmentsNotSupportedError's message (PDFs: convert to text
or switch model); a provider refusal is mapped to the same message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
…ng, sorted tools - Prompt caching now also moves an Anthropic breakpoint to the newest message of every tool-loop round (stale message breakpoints removed, so a request carries at most two), so each round reads the earlier rounds from cache. - Context editing inside a step's tool loop: past compaction.clearToolResultsAfterTokens the oldest tool results become one-line stubs (sticky), keeping the newest keepToolResults; reported as context.compacted with scope 'tool-results'. - Tools are sorted by name, so the cached prefix is identical regardless of MCP connection order. - docs/capabilities.md: a "Token efficiency" section mapping the practices of Claude Code / Copilot to the agent's knobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
Some servers repeat tool call ids across rounds; keying the sticky set by the result's position (the loop only appends) clears exactly the oldest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
Sorting tools by name bought no cache stability (hosts merge their tool sets in a fixed order, useMcpServers in list order) and reorders what a server declared. Measured with a local Qwen2.5-3B (the Node sibling's release gate): tool order swings a 3B either way, so the agent no longer imposes one. sortTools is removed (it was never released). Version 0.0.20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
siarheidudko
marked this pull request as ready for review
October 3, 2026 00:39
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.
This PR implements the agent spec it shares with
@dudko.dev/agent(Node; released as 0.0.31): the same config fields, events and semantics. Full documentation is indocs/capabilities.md. Releases as 0.0.20.What's in it
Thinking
thinking/stageThinkingmap to the AI SDK's portablereasoninglevel, plus provider budgets.step.reasoning-delta/final.reasoning-delta.Limits
maxToolCallsandmaxPlanSteps.budget.exceeded, and still produces an answer.Compaction
agent.compact().compaction.clearToolResultsAfterTokens, the oldest tool results become one-line stubs. Clearing is sticky and keyed by position.Skills
SKILL.mdformat from agentskills.io.load_skill).read_skill_filereads bundled files.Tool consent
autopilot,ask-writes,ask-all,read-only.setToolApprovalModeswitches the mode live.Large catalogues
toolSelectionStrategy: 'auto'switches tofind_toolssearch abovetoolSearchThreshold.Prompt caching
promptCacheKey.Subagents
createSubagentToolruns in-process or in a Web Worker (serveSubagentWorker).Attachments
AttachmentsNotSupportedErrorgives an actionable message instead of a raw provider error.Virtual file system
VirtualFileSystem(IndexedDB) pluscreateFileTools.Autonomy
Merge order
dudko-dev/agent— merged and released as 0.0.31.dudko-dev/agent-web-react— next, once 0.0.20 is on npm.Checks
npm run typecheck,npm run format:check,npm run buildandnpm testall pass (144 tests). CI is green.🤖 Generated with Claude Code
https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5