fix(framework): remove the harness system prompt for CLI agents (AI-1034) - #241
fix(framework): remove the harness system prompt for CLI agents (AI-1034)#241seanoliver wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| if (agent !== 'ai-sdk') return ''; | ||
| if (mode === 'local-stack') { | ||
| return ( | ||
| 'You are an agent solving a Supabase eval task in a Linux workspace. ' + |
There was a problem hiding this comment.
Could we also tie in the fix for #164 here? I.e. we shouldn't mention that this is a Supabase eval or that there is a "project" needing to be modified, as that could give an unfair advantage to the non terminal-agent experiments.
I recognize it's a minor issue at this point, since only the AI SDK harness is affected here, which is no longer used in our benchmarks / regression runs. Might end up taking it out entirely. But also easy to clean up while we're here.
There was a problem hiding this comment.
Done. The base prompt is now one line, the same in both modes: You are an agent. Use the provided tools to complete the task. No Supabase, project, or eval in it, and a test asserts that.
| process.env[API_KEY_ENV_VAR] = 'k'; | ||
| }); | ||
|
|
||
| it('stages a system prompt and hands its path to the runner', async () => { |
There was a problem hiding this comment.
Do we still need to support system prompt overrides for terminal agents?
Seems like that's now legacy behavior we won't want to support going forward, I think there's a cleanup / code deletion opportunity here. It's a bit convoluted to support the plumbing of writing a system prompt to a file that's read from inside the container.
The only use case I can think of is the executor example cited in the PR, but (a) the only experiments that use executor are AI SDK ones which don't need this system prompt file workaround (b) we don't use the executor experiments, they're just POC placeholders (c) we could achieve the same thing with an addendum on the user prompt.
There was a problem hiding this comment.
Agreed. It's deleted: createCliAgent no longer stages a system prompt file or passes a path to the runner, and the three runners lost their flag/prepend branches. A non-empty systemPrompt for a CLI agent now throws instead of being dropped, so pairing the executor MCP with a CLI agent fails loudly. If anyone wants that pairing later, the protocol text goes on the user prompt as you suggested.
| agentReport: string; | ||
| stoppedReason: string; | ||
| /** | ||
| * The exact system prompt handed to the agent (`''` when it got none). CLI |
There was a problem hiding this comment.
If we end up keeping this for terminal agents, I'd clarify here that it's more of an optional thing appended to the system prompt, not replacing it with this exact string alone.
There was a problem hiding this comment.
This is moot now that the override is gone. What remains here is that each run records the systemPrompt it sent, '' for CLI agents.
createCliAgent no longer stages a system prompt file or hands a path to the runner. Claude Code drops --append-system-prompt-file; Codex and OpenCode send the task alone instead of prepending a block to the user prompt. A non-empty systemPrompt now throws rather than being dropped.
…034) buildToolSurfaceAddendum and buildSkillsPrompt return '' for every CLI harness: those describe in-process tools only aiSdkAgent has, and each CLI discovers the installed skills itself. The bare sandbox no longer takes an agent or returns a promptAddendum.
…s (AI-1034) Prompt assembly moves to system-prompt.ts so it can be unit tested. The ai-sdk base prompt no longer names Supabase, a project, or how to end the turn (#164), and is the same in both modes. CLI agents get an empty prompt. Each run records the system prompt it sent.
5bed078 to
3cefa60
Compare
…arness-native-prompts # Conflicts: # apps/framework/harness/run-eval.ts # packages/core/src/agents/codex/runner.test.ts

This is stacked on #240. Review that first; this diff is against it. No results are touched.
Problem
We wrote our own system prompt into every eval run, for all four agents:
bashandfiles_read, which only the in-processai-sdkagent has.agentReport, which the LLM judge reads. That is a scoring change.Changes
ai-sdkclaude-codecodexopencodecreateCliAgentno longer stages a system-prompt file or passes a path to the runner;--append-system-prompt-fileand the Codex/OpenCode prepend are gone. A non-emptysystemPromptfor a CLI agent throws.ai-sdkbase prompt is nowYou are an agent. Use the provided tools to complete the task.It is the same in both modes. No Supabase, no project, no stopping instructions.buildToolSurfaceAddendumandbuildSkillsPromptreturn''for every CLI agent. The bare sandbox no longer takes anagentor returns apromptAddendum.run-eval.tsintosystem-prompt.tsso it can be unit tested.systemPromptin its rawresult.json.export-resultsdrops it, so nothing reaches the site.Since the first review: the system-prompt-file plumbing for CLI agents is deleted rather than made optional, and the ai-sdk base prompt is rewritten for #164. The branch is re-applied on the current #240 (the retry loop is gone there), so the commits are new. #240 now has
mainmerged in, which brings the usage and duration fields from #270.Testing
pnpm --filter @supabase-evals/core test,pnpm --filter @supabase-evals/sandbox test,pnpm --filter @supabase-evals/framework test,pnpm --filter @supabase-evals/web test: all pass locally.typecheckfor framework, sandbox and web passes.biome check .is clean.Score movement
Full benchmark on both branches before this revision, artifact only, nothing published. Both used
runs=2.claude-codecodexopencodeThis looks like run-to-run variability. Once #229 lands and scores average across runs, the numbers should settle.
Follow-ups
evals/resolve-performance-001-slow-query-cpu-spike/PROMPT.md:15, the last one left. It sits in the task text so it hits every agent equally, and removing it invalidates that eval's recorded results, so it should be a separate change.Ref AI-1034