feat(coding-agent): removed context argument from eval agent() spawn
Shared background now flows through a '/Users/can/.omp/agent/sessions/-Projects-.tree-pi-commit/2026-06-10T15-36-32-782Z_019eb22d-970e-7000-8964-72c98becf3e8/local' file referenced in each prompt instead of a context string forwarded into the subagent's system prompt. The JS and Python preludes drop the context kwarg from agent(), the subagent system prompt drops the {{#if context}} block and the conversation-context file pointer, and runEvalAgent no longer writes a per-call conversation context file. AgentSession sheds the now-unused formatCompactContext() helper that supplied the file's body, and ToolSession.getCompactContext is removed alongside it.
This commit is contained in:
@@ -231,10 +231,8 @@ import type { AuthStorage } from "./auth-storage";
|
||||
import type { ClientBridge, ClientBridgePermissionOption, ClientBridgePermissionOutcome } from "./client-bridge";
|
||||
import {
|
||||
type BashExecutionMessage,
|
||||
type CompactionSummaryMessage,
|
||||
type CustomMessage,
|
||||
convertToLlm,
|
||||
type FileMentionMessage,
|
||||
type PythonExecutionMessage,
|
||||
readPendingDisplayTag,
|
||||
SILENT_ABORT_MARKER,
|
||||
@@ -9960,69 +9958,6 @@ export class AgentSession {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the conversation as compact context for subagents.
|
||||
* Includes only user messages and assistant text responses.
|
||||
* Excludes: system prompt, tool definitions, tool calls/results, thinking blocks.
|
||||
*/
|
||||
formatCompactContext(): string {
|
||||
const lines: string[] = [];
|
||||
lines.push("# Conversation Context");
|
||||
lines.push("");
|
||||
lines.push(
|
||||
"This is a summary of the parent conversation. Read this if you need additional context about what was discussed or decided.",
|
||||
);
|
||||
lines.push("");
|
||||
|
||||
for (const msg of this.messages) {
|
||||
if (msg.role === "user" || msg.role === "developer") {
|
||||
lines.push(msg.role === "developer" ? "## Developer" : "## User");
|
||||
lines.push("");
|
||||
if (typeof msg.content === "string") {
|
||||
lines.push(msg.content);
|
||||
} else {
|
||||
for (const c of msg.content) {
|
||||
if (c.type === "text") {
|
||||
lines.push(c.text);
|
||||
} else if (c.type === "image") {
|
||||
lines.push("[Image attached]");
|
||||
}
|
||||
}
|
||||
}
|
||||
lines.push("");
|
||||
} else if (msg.role === "assistant") {
|
||||
const assistantMsg = msg as AssistantMessage;
|
||||
// Only include text content, skip tool calls and thinking
|
||||
const textParts: string[] = [];
|
||||
for (const c of assistantMsg.content) {
|
||||
if (c.type === "text" && c.text.trim()) {
|
||||
textParts.push(c.text);
|
||||
}
|
||||
}
|
||||
if (textParts.length > 0) {
|
||||
lines.push("## Assistant");
|
||||
lines.push("");
|
||||
lines.push(textParts.join("\n\n"));
|
||||
lines.push("");
|
||||
}
|
||||
} else if (msg.role === "fileMention") {
|
||||
const fileMsg = msg as FileMentionMessage;
|
||||
const paths = fileMsg.files.map(f => f.path).join(", ");
|
||||
lines.push(`[Files referenced: ${paths}]`);
|
||||
lines.push("");
|
||||
} else if (msg.role === "compactionSummary") {
|
||||
const compactMsg = msg as CompactionSummaryMessage;
|
||||
lines.push("## Earlier Context (Summarized)");
|
||||
lines.push("");
|
||||
lines.push(compactMsg.summary);
|
||||
lines.push("");
|
||||
}
|
||||
// Skip: toolResult, bashExecution, pythonExecution, branchSummary, custom, hookMessage
|
||||
}
|
||||
|
||||
return lines.join("\n").trim();
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Extension System
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user