Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
17e8923
docs(design): agent-config-editing planning workspace
mmabrouk Aug 4, 2026
df70c8e
docs(design): spike reports, consolidated decisions, status update
mmabrouk Aug 4, 2026
bc0003e
docs(design): NO-GO gate review saved; contract-writing phase before …
mmabrouk Aug 4, 2026
6549f38
docs(design): six implementation contracts + arbitration and open calls
mmabrouk Aug 4, 2026
eeb692d
docs(design): gate 2 NO-GO recorded; slice plan rewritten; product ca…
mmabrouk Aug 4, 2026
86ac5e3
docs(design): gate 2 fixes across all six contracts; arbitrations rec…
mmabrouk Aug 4, 2026
2ba04b8
docs(design): gate 3 verdict: GO for S4+S5; five contract corrections…
mmabrouk Aug 4, 2026
80fc336
docs(design): gate 3 plan corrections: dark rollout, two-point kill s…
mmabrouk Aug 4, 2026
adeaa0c
docs(design): gate 3 fixes across the four affected contracts
mmabrouk Aug 4, 2026
5f512e2
docs(design): status: S4 and S5 landed on stacked lanes
mmabrouk Aug 4, 2026
494a3e5
docs(design): reviewer briefing: goal, plan, findings, implicit decis…
mmabrouk Aug 5, 2026
78d2ce1
docs(design): briefing expanded: spikes, contracts, discoveries, slic…
mmabrouk Aug 5, 2026
9db30ea
docs(design): model usability spike: Haiku 34%->100% via tuned instru…
mmabrouk Aug 5, 2026
a3924b9
docs(design): post-spike arbitrations: @ag.file marker, instructional…
mmabrouk Aug 5, 2026
a00a345
docs(design): v3 arbitrations: 1.5KB instructions ship with three con…
mmabrouk Aug 5, 2026
1bb878e
docs(design): briefing: clarify the live-tool-updates consequence sen…
mmabrouk Aug 5, 2026
0adab24
docs(design): Mahmoud's review decisions: uniform tool reopen, per-cl…
mmabrouk Aug 5, 2026
b692353
docs(design): review round: refactor steps detailed, reconciliation d…
mmabrouk Aug 5, 2026
c1e40c9
docs(design): decision 1 answered (exact bytes); rollout corrected to…
mmabrouk Aug 5, 2026
c543f70
docs(design): v4 spike arm: executable flags found from schema alone;…
mmabrouk Aug 5, 2026
ea448a4
docs(design): change-set contract consolidated to final decided state…
mmabrouk Aug 5, 2026
0da1c76
docs(design): decisions 2/4/5/6 confirmed; LF stays significant in ma…
mmabrouk Aug 5, 2026
4b61d42
docs(design): decision 6 amended (no migration; audit via existing me…
mmabrouk Aug 5, 2026
17e9639
docs(design): all six product calls closed; dao lock impact note landed
mmabrouk Aug 5, 2026
27384d4
docs(design): import contract aligned: /proc/self/fd walk documented,…
mmabrouk Aug 5, 2026
7c4be6b
docs(design): replayability condition recorded in the adapter matrix;…
mmabrouk Aug 5, 2026
24f1e99
docs(design): §4 gating text replaced with the decision as taken
mmabrouk Aug 5, 2026
1717064
docs(design): rotation ruling: option 2, rotate in place with propaga…
mmabrouk Aug 5, 2026
8e87db1
docs(design): contracts synced to shipped behavior; §11 acceptance li…
mmabrouk Aug 5, 2026
26b8c3e
docs: final review round outcomes (contracts synced to fixes, finding…
mmabrouk Aug 5, 2026
cdc6c1d
docs: final status and the E2 enforcement-seam ruling
mmabrouk Aug 5, 2026
988403a
docs: E2E campaign outcomes (ancestor scope rule, refresh env.plan wo…
mmabrouk Aug 5, 2026
d4f0707
docs: CodeRabbit review corrections (superseded banners, counts, spik…
mmabrouk Aug 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
563 changes: 563 additions & 0 deletions docs/design/agent-config-editing/BRIEFING.md

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions docs/design/agent-config-editing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Agent config editing

An agent in the Agenta playground can edit its own configuration. Today every edit must
resend the full content, which wastes tokens, breaks above ~4.8 KB, and silently replaces
whole lists. This project replaces that with targeted operations, and refactors the runner
so small configuration changes stop forcing a full sandbox rebuild.

## Reading order

| File | Answers |
|---|---|
| `context.md` | Why this work exists. Goals, non-goals, user stories. |
| `plan.md` | The execution plan: slices, order, QA gates. |
| `status.md` | Where the work stands right now. Decisions and blockers. |
| `contracts/change-set.md` | The change-set engine, decided. Where any other document disagrees with it, this one wins. |
| `contracts/execution-authorization.md` | Execution authorization for workspace file references, decided. |
| `contracts/workspace-import.md` | The workspace import boundary, decided. |
| `contracts/adapter-matrix.md` | The harness reconciliation matrix, decided. |
| `contracts/commit-transaction.md` | The atomic commit transaction and its wire response, decided. |
| `contracts/read-config.md` | `read_config`, the editable scope, and the call description, decided. |
| `research.md` | What the codebase research found, with file references. |
| `research/rfc.html` | The original RFC: requirements, design questions. Historical context; the `contracts/` files carry the decided answers. |
| `research/change-set-interface-codex.md` | The pre-consolidation change-set interface spec. Historical; superseded by `contracts/change-set.md`. |
| `research/runner-lifecycle-codex.md` | The pre-consolidation runner lifecycle architecture. Historical; superseded by `contracts/adapter-matrix.md`. |
| `spikes/engine-spike.md` | Findings from the change-set engine prototype. Historical. |
| `spikes/runner-spike.md` | Findings from the runner-side spikes. Historical. |

The `contracts/` files are the implementation source of truth. `research/` and `spikes/`
record how we got there; read them for context, not for the current behavior.

## Glossary

- **Configuration**: the JSON object at `parameters.agent` in a revision. It holds the
instructions, the model, the tools, the skills, the MCP servers, the harness, and the
permissions.
- **Revision**: one committed version of the configuration. Revisions are immutable.
- **Harness**: the coding agent that runs inside the sandbox (Pi, Claude Code, or Codex).
- **Runner**: the TypeScript service (`services/runner`) that creates sandboxes, writes
workspace files, opens harness sessions, and executes turns.
- **Sandbox**: the isolated machine (local process or Daytona VM) the harness runs in.
- **Warm session**: a sandbox plus harness session the runner keeps alive between turns.
- **Fingerprint**: today, one checksum over all configuration values. The runner compares
it to decide whether a parked warm session can be reused.
- **Builder tools**: platform tools (commit_revision and others) injected into playground
runs only, never stored in the configuration.
- **Change set / delta**: the payload of a commit: what to change relative to a base.
65 changes: 65 additions & 0 deletions docs/design/agent-config-editing/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Context

## What happens today

You build an agent by talking to it in the playground. The agent edits its own
configuration through a platform tool, `commit_revision`. The tool takes a change:
`set` (a partial object, deep-merged) and `remove` (dotted paths to delete). The merge
recurses into objects only. Scalars and lists are replaced whole.

Four consequences drive this project:

1. **Every edit is a full rewrite.** The instructions are one string. Skills, tools, and
MCP servers are lists. To fix a typo, the agent resends the whole file. To change one
skill, it resends every skill with every bundled file.
2. **Large payloads fail.** Tool-call arguments above ~4.8 KB arrive truncated on the
Claude harness (issue #5554). A downloaded skill folder cannot be committed at all,
because the agent must retype its full content through the tool call.
3. **Stale writes are silent.** The commit merges onto the latest committed revision. If
someone else moved the head, the write silently overwrites their change.
4. **Any change throws away the warm session.** The runner decides warm reuse with one
checksum over the whole configuration. Change one word, and the next turn pays a full
rebuild: about 12.5 seconds instead of 1.4. A configuration mismatch even deletes the
Daytona sandbox instead of stopping it.

The agent also cannot read its own configuration before it writes (issue #5186), and the
shipped guidance compensates for missing commit validation by demanding a full live test
run after every change.

## Goal

One working stacked PR set that lets an agent:

- edit one line of its instructions with an anchored text edit (US-1),
- edit one line of one skill without touching the others (US-2),
- install a large downloaded skill by pointing at its folder in the workspace (US-3),
- add or remove one tool by name (US-4),
- read its configuration, in parts, before writing (US-5),
- fail loudly and retry when the base moved, instead of overwriting (US-7),

and refactors the runner so sessions stay correct and cheap when the configuration
changes (US-8): update in place for most values, rebuild only when the harness kind or
the sandbox provider changes.

## Non-goals

- **US-6, run a change without saving it.** Moved out of scope on 4 August. The change-set
format stays compatible so this can come back later.
- **Full approval-screen redesign.** The frontend work is minimal: show the agent's
description on tool cards, and show name, file list, and diff on folder-commit
approvals.
- **Push notifications to running sessions.** Correctness does not need them. Deferred.
- **A CLI in the sandbox.** Closed: it would need credentials inside the sandbox.
- **A configuration file in every workspace.** Closed: shared agents must not expose
internals, and a stale file gives the agent no recovery action.

## Requirements

The full numbered list (R1 to R12) is in `research/rfc.html`, section 4. The short form:
edits cost tokens proportional to the change; large content moves by workspace reference;
every target has a stable address with unique names enforced at commit; stale commits
fail loudly; the agent can read its config in parts with a draft flag; everything works
on all three harnesses and both sandboxes; builder tools stay playground-only and
self-targeted; no credential enters the sandbox; no session runs a stale configuration;
the commit validates shape; builder tool calls carry an optional agent-written
description that the frontend shows.
Loading
Loading