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 6127186
Browse filesBrowse the repository at this point in the historyBrowse files
feat(coding): #3 Step 1 — one smart Agent input (answer from context OR delegate)
The Agent chat used to always relay to Claude. Now it routes: a new
POST /coding/sessions/:id/agent runs a tool-loop — the BYOK LLM answers from the
terminal + session memory for questions, or calls a `drive_claude` tool to
delegate actions to Claude Code (which then runs + the finish watcher
notifies). `@claude` / `/run` forces delegation. Context-first, delegate-on-action.
This is the reusable engine the cross-repo Overseer (#9) lifts to global scope —
swap per-session context for all-repos context + memory + drive_claude(repoId).
Frontend: Send now calls /agent; placeholder/tooltip updated; the read-only
Status button stays for a forced context summary.
Refs #3#9
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
<inputid="inst-coding-ask" placeholder="Tell the agent what to do — it types into Claude for you…" style="flex:1;min-width:140px" onkeydown="if(event.key==='Enter')sendCodingInstruction()">
349
+
<inputid="inst-coding-ask" placeholder="Ask about it, or tell it to do something — it routes for you (@claude forces)…" style="flex:1;min-width:140px" onkeydown="if(event.key==='Enter')sendCodingInstruction()">
<buttontype="button" id="inst-coding-send" class="btn btn-primary btn-sm" onclick="sendCodingInstruction()" title="Send to Claude — the agent types it into the CLI for you, then reports back">Send</button>
352
+
<buttontype="button" id="inst-coding-send" class="btn btn-primary btn-sm" onclick="sendCodingInstruction()" title="Send — it answers from context or drives Claude, whichever fits. Prefix @claude to force delegation.">Send</button>
353
353
<buttontype="button" class="btn btn-outline btn-sm" onclick="refreshCodingSummary()" title="What's it doing right now? (read-only — doesn't interrupt Claude)">Status</button>
354
354
<buttontype="button" class="btn btn-outline btn-sm" onclick="clearCodingSummary()" title="Clear this conversation (keeps the activity log)">🧹</button>
"You are the co-pilot for an AI coding agent working in the user's repo. ONE rule decides what you do:\n"+
407
+
"- If the user is ASKING (status, what happened, why, explain) → answer concisely FROM the terminal + session memory below. Never claim you did work.\n"+
408
+
"- If the user wants something DONE (change/add/fix/run/build/test) OR you'd need live repo state you don't have → call the `drive_claude` tool with ONE clear instruction for Claude Code to execute. Don't try to do the work yourself.\n"+
409
+
"Plain language, tight. Default to answering; delegate when it's an action.";
410
+
constuserMsg=`User: ${raw}\n\nSESSION MEMORY (recent):\n${memory||"(none)"}\n\nTERMINAL (recent):\n${pane.slice(-6000)||"(no live terminal)"}`;
411
+
consttools=[
412
+
{
413
+
type: "function",
414
+
function: {
415
+
name: "drive_claude",
416
+
description: "Delegate an action to Claude Code running in the repo (it edits files, runs commands). Use for any request to DO work.",
417
+
parameters: {type: "object",properties: {instruction: {type: "string",description: "A single clear instruction for Claude Code."}},required: ["instruction"]},
0 commit comments