feat: upgrade built-in agent engine to multi-step tool calling & agent profiles (#398) #419
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 395 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #419"
general
weight: 0.35
qwts
Part of #394
Closes #398
Summary
src/llm/aiVendor.js): ExportstoolandstepCountIsfrom"ai"behind the dynamic import seam (src/llm/index.js), verified lazy byscripts/check-chunk-laziness.mjs.src/llm/agentRunner.js+src/llm/index.js): AddsrunAgent(...)onLLMProvider, bridging canonical registry tools viavendor.tool/vendor.jsonSchemaandvendor.stepCountIs(maxSteps)(capped 1–12, 60s total timeout,abortSignal).- Fail-Closed Containment: Wraps untrusted tool outputs (every string leaf and non-identifier object key except a minimal safe structural/token allowlist, plus
error.message) in<bookmark_data>...</bookmark_data>with delimiter/attribute neutralization and a 24k-char total payload cap, while delivering unwrapped step events to UI listeners.- Local-Model Non-Tool Fallback: When a provider/model rejects native tool calling (
UnsupportedFunctionalityErroror tool-unsupported errors), automatically falls back to a dynamic single-shot JSON schema generated from the active agent's resolved tool list and routes calls through the samePolicyGate.src/tools/agentProfiles.js+src/hooks/useAgentConfig.js): Defines 4 built-in profiles (assistant,librarian,link-doctor,researcherwith lockedread_onlypolicy) and persists profile & WebMCP toolset/policy overrides in local-only storage (extensionStorage.js, never.sync), re-sanitizing all fields on read as untrusted data.src/hooks/useAgentEngine.js,src/hooks/useAppController.js,src/hooks/useWebMcpTools.js,src/components/BookmarkApp.jsx):- Unifies provider/model override resolution (
resolveEffectiveAgentLlm), enforcesallowAutonomousDestructive: false, and adds liveisProcessing,lastRun, andcancel().- Removes the legacy
runPlanSteps,handlePersistReorderFromAgent,widenSearch, andREORDER_ACTIONSdispatch ladder fromBookmarkApp.jsx(reducingBookmarkApp.jsxfrom 2,200 to 2,150 lines) while keepingsrc/llm/normalize.jsandsrc/utils/smartViews.jscompatibility intact.- Adds a compact accessible running/stop/reply banner in
BookmarkApp.jsxand wiresuseAgentConfig's WebMCP toolsets/policy intouseWebMcpTools.DESIGN.mdand adds.changeset/multi-step-agent-engine.md.Verification
npx eslint --max-warnings=0on all new/modified LLM, tool profile, hook, controller, and message modules: 0 errors, 0 warnings.npm run ci </dev/nullpassed completely (check:version-policy,licenses:notices:check,format:check,lint, all 128 Vitest suites / 1,620+ tests,build:chromewithscripts/check-chunk-laziness.mjs, andbuild:storybook).APPROVEDafter fixing B1–B3 and NB1–NB5).<!-- agent-bot-write: ghw_3a02ef514a4d8f5b session=210bdd5e08f0 bot=trueline-antigravity-agent[bot] conversation_id=e99b26b3-53f9-4d7f-8337-fb33257bb240 conversation_id_source=self-reported -->