You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 16f3d1d
Browse filesBrowse the repository at this point in the historyBrowse files
Four features on the agentic core (all in extensions/atom-ai/, plain JS):
- M5 diagnostics-driven auto-verify loop: after edits land and the model
goes to finish, pull getDiagnostics for the files touched THIS run (new
errors only — diffed vs a pre-run baseline keyed by severity+message so
pre-existing/unrelated problems and line-shifts don't trigger a chase) and,
if a verify command is set, run it through the live-terminal plumbing.
Failures are injected back as a synthetic turn so the agent self-corrects,
bounded by verify.maxRounds AND maxSteps, abort-safe, shown as a live verify
card. A command that can't run (missing npm script / not found / exit 127) is
classified config-not-code: warn the user, never loop the agent on it. New
pure, unit-tested verify.js; settings atompp.ai.verify.{enabled,command,
maxRounds,includeWarnings} (diagnostics-only by default, zero-config).
- Context-window UI (Claude-Code style): footer donut ring that fills +
recolors by pressure; click opens a breakdown popover (segmented bar +
Messages / System prompt / Tools / Free-space rows with tokens + %),
live-updating during a run. agent.js now reports system/tools token
estimates so the split is real.
- Malformed-tool-use 400 recovery: a tool_use truncated by max_tokens used to
leak an internal `_malformed` marker into the re-sent message, which the API
rejected ("Extra inputs are not permitted"). providers.js now builds
API-clean blocks by construction via finalizeAgentBlocks() and carries the
malformed signal in a separate Set; the agent recovers ("retry smaller")
instead of erroring.
- Step-limit Continue affordance: when the agent stops at maxSteps it now shows
an explanation + a one-click Continue (resumes the persistent transcript,
preserves the original goal for Retry) instead of a dead-end "Stopped".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
"You are Atom++'s built-in autonomous coding agent. You accomplish the user's goal in their",
@@ -27,7 +28,8 @@ const SYSTEM = [
27
28
'- Paths are relative to the workspace root.',
28
29
'- For a multi-step goal, call update_plan FIRST with a short checklist (3-8 short items, all "pending"), then call it again to set an item "in_progress" when you start it and "done" when finished. Skip the plan for trivial single-step goals.',
29
30
'- If the goal truly depends on a decision only the user can make (tech stack, scope, where to create files, must-have features), call ask_user ONCE with concise multiple-choice questions (a short header + 2-4 concrete options each) INSTEAD of writing the questions as prose. Then act on their answers and do not ask again. Do NOT ask about things you can reasonably decide yourself — prefer a sensible default and proceed.',
30
-
'- When the goal is finished, end with a one-line summary starting with "Done:" and STOP (no more tools).'
31
+
'- When the goal is finished, end with a one-line summary starting with "Done:" and STOP (no more tools).',
32
+
'- After you finish, your work is verified automatically: editor diagnostics for the files you changed (plus a verify command, if the user configured one) are checked. If problems are found you will get them back as a follow-up message — fix the ones you introduced, then finish again with "Done:". If a reported problem is clearly pre-existing and unrelated to the goal, do not chase it: note it in one line and finish.'
31
33
].join('\n');
32
34
33
35
constTOOLS=[
@@ -41,6 +43,11 @@ const TOOLS = [
41
43
{name: 'ask_user',description: 'Ask the user one or more multiple-choice questions when the goal genuinely depends on a decision only they can make (tech stack, scope, where to put files, must-have features). The user picks by CLICKING — do NOT write questions as prose. Ask ONCE up front with all your questions, then proceed with the answers and never re-ask. Prefer sensible defaults over asking; only ask when a wrong guess would waste real work.',input_schema: {type: 'object',properties: {questions: {type: 'array',items: {type: 'object',properties: {header: {type: 'string',description: 'a 1-3 word tag for the question'},question: {type: 'string'},multiSelect: {type: 'boolean',description: 'true if several options can be picked at once'},options: {type: 'array',items: {type: 'object',properties: {label: {type: 'string'},description: {type: 'string'}},required: ['label']}}},required: ['question','options']}}},required: ['questions']}}
42
44
];
43
45
46
+
// Rough token estimates (chars/4) for the static prompt segments, so the context popover can break
47
+
// down "what's filling the window" — system + tools are sent on every request, the rest is messages.
// Guard: never push an empty assistant message — Anthropic 400s on content:[] (e.g. a
@@ -365,7 +435,7 @@ async function runAgent(ctx) {
365
435
letcancelled=false;
366
436
for(consttuoftoolUses){
367
437
if(cancelled||ctx.signal.aborted){cancelled=true;dbg('tool.cancelled',{name: tu.name});results.push({type: 'tool_result',tool_use_id: tu.id,content: 'Cancelled by the user.'});continue;}
368
-
if(tu._malformed){dbg('tool.malformed',{name: tu.name});results.push({type: 'tool_result',tool_use_id: tu.id,content: 'ERROR: your tool arguments were cut off (truncated JSON). Retry with smaller input — for edits use edit_file with a short snippet.'});continue;}
438
+
if(turn.malformed&&turn.malformed.has(tu.id)){dbg('tool.malformed',{name: tu.name});results.push({type: 'tool_result',tool_use_id: tu.id,content: 'ERROR: your tool arguments were cut off (truncated JSON). Retry with smaller input — for edits use edit_file with a short snippet.'});continue;}
case'continueAgent': if(!abort){constg=lastAgentGoal;dbg('continue',{transcriptMsgs: agentMessages.length});awaitagentFlow('Continue from where you left off and finish the task. Pick up exactly where you stopped — do not restart or repeat work that is already done.');lastAgentGoal=g;}break;
0 commit comments