Skip to content

dagger agent dev env: in-repo agent modules - #13838

Open
vito wants to merge 105 commits into
llm-workspace-host-gitfrom
llm-workspace-dev-env
Open

vito wants to merge 105 commits into
llm-workspace-host-gitfrom
llm-workspace-dev-env

Conversation

@vito

@vito vito commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

The dogfooding layer: the in-repo agent modules that dagger agent --env dev composes, plus the wiring that makes them reachable. No engine changes.

module what it does
editor a sandboxed coding agent — read, write, edit, find, grep, todoWrite — plus a commit tool built on the workspace's staged commits. Vendored from github.com/vito/editor so it can be iterated on in-tree.
review the git status / git diff an agent with no Bash tool can't otherwise get, via Workspace.git.uncommitted's diffstats and patch
history the git log half of the same, over Workspace.git.stagedCommits
delegate hands a noisy, context-heavy subtask to a fresh sub-agent that runs it in its own conversation and returns one distilled report
engine-lab ./hack/dev + ./hack/with-dev as agent tools: build from the workspace, hold the engine as a Service, exec against it, poke its debug endpoints
contributor the same idea aimed at somebody else's repo — fetch it as a Workspace, compose editor's tools onto it, work the task, open the PR
tui-qa drives nested agent TUI sessions; now inherits the session's LLM config and gets a real git repo as its fixture

Supporting changes: EngineDev.GoContainer is a Wolfi Go base with the from-source dagger on $PATH, so Go commands (and the integration tests, which shell out to dagger) find the CLI without paying for a full engine build — it's what the golang toolchain is based on in the dev env. dagger.toml gains the env.dev module set, with contributor's GitHub token resolving through cmd://gh auth token rather than being stored. And catwalk moves to v0.51.11 for its refreshed model catalog.

Each module commit is self-contained, and the dagger.toml wiring is last, so any intermediate state is a module directory with no install entry — inert rather than broken.

@vito vito changed the title llm workspace dev env dagger agent dev env: in-repo agent modules Aug 4, 2026
@vito
vito marked this pull request as ready for review August 4, 2026 23:45
@vito
vito force-pushed the llm-workspace-dev-env branch 2 times, most recently from 633ec5b to df99c7a Compare August 5, 2026 14:59
@vito
vito force-pushed the llm-workspace-dev-env branch from df99c7a to 688b30b Compare August 5, 2026 15:30
@vito
vito force-pushed the llm-workspace-dev-env branch from 688b30b to 2a1c408 Compare August 6, 2026 14:26
@vito
vito requested review from a team as code owners August 7, 2026 01:27
@vito
vito force-pushed the llm-workspace-dev-env branch from 2a1c408 to dac95e4 Compare August 7, 2026 01:38
@vito
vito force-pushed the llm-workspace-dev-env branch 3 times, most recently from 6432cbb to 72a3846 Compare August 13, 2026 21:02
@vito
vito force-pushed the llm-workspace-dev-env branch from 76108d2 to e9310ff Compare August 17, 2026 22:34
@vito
vito force-pushed the llm-workspace-dev-env branch from e9310ff to 8c798f1 Compare August 18, 2026 00:07
@vito
vito force-pushed the llm-workspace-dev-env branch from d6916ac to 210a9f5 Compare August 18, 2026 01:15
vito and others added 15 commits August 28, 2026 16:47
Record the six agent-to-agent messaging pitfalls found while dogfooding
modules/staff, and design around one rule: an agent turn never blocks on
the progress of another agent. Define message provenance, replyTo replies,
lifecycle events through Agent.notify, waitSettled, and cycle refusal at the
blocking primitives. Point the superseded async-agents threads at this
design.

Signed-off-by: Alex Suraci <[email protected]>
Give each message enqueued into an agent mailbox a resolved origin.
Resolve it at the central enqueue path from the ambient loop agent or the
calling client function-call record. Record it as an optional withPrompt
argument, so that the conversation chain says who said what, and render it
as an attribution header that the model sees. Record nothing for plain user
prompts and self-sends, so that older chains stay byte-stable.

Signed-off-by: Alex Suraci <[email protected]>
Add Agent.waitSettled, which blocks until the projection reaches IDLE,
FAILED, or STOPPED. A waitFor(IDLE) on a failed agent hangs forever because
a FAILED projection never reaches IDLE by itself.

Signed-off-by: Alex Suraci <[email protected]>
Register a waits-for edge for each blocking wait issued from an agent
turn, and release it when the wait returns. Refuse a wait that would close a
cycle, and return the named path as the tool result. Refuse self-waits
always. Do not register waits from callers that are not agents.

Signed-off-by: Alex Suraci <[email protected]>
Add replyTo to Agent.send, which names a message in the sender mailbox
by its ref. The recipient sees the question and answer paired, and awaiters
of the replied-to message resolve at once. Refuse a mistyped ref. Expose the
ref on AgentMessage. Keep turn-end resolution as the fallback.

Signed-off-by: Alex Suraci <[email protected]>
Add Agent.notify, which subscribes one agent to the projected state
transitions of another. Each transition enqueues an EVENT message that
steers the open turn or wakes an idle subscriber. IDLE events carry the final
reply and FAILED events carry the loop error. Never relaunch a STOPPED
subscriber. Create the subscriber entry at subscribe time so that events
queue before it starts. Expose Agent.error for a FAILED loop.

Signed-off-by: Alex Suraci <[email protected]>
The replayer dropped the leading SYSTEM message in all cases. A
conversation with an explicit system prompt lost its real prompt and
diverged at index 0. Trim the leading system message only when it is not
the one in the recording.

Signed-off-by: Alex Suraci <[email protected]>
Remove the blocking ask verb. Make askChief return at once with the
question ref, so that the chief answers with sendTo(replyTo:). Subscribe
the chief to each worker lifecycle at spawn, and base collect on waitSettled
so that it reports a failed worker instead of hanging. Rewrite the prompts
for the event loop and replace the skipped test with the event-driven
choreography. Record the as-built deltas in the design.

Signed-off-by: Alex Suraci <[email protected]>
Put the recorded origin on the prompt span as dagger.io/llm.origin.*
attributes and ingest them in dagui. Show an AGENT-origin message under a
sender attribution header, and collapse an EVENT-origin message to a faint
one-liner in the live transcript and the final report. Keep plain user
prompts unchanged.

Signed-off-by: Alex Suraci <[email protected]>
Add Staff.workerPromptFor(name:), which appends the staff name to the
worker prompt, and compose it into each spawned worker. Exclude both prompt
constants from the chief toolset. Build the test recording from the composed
prompt and assert that the name is in the text.

Signed-off-by: Alex Suraci <[email protected]>
A resume of a FAILED worker relaunched its loop with an empty mailbox
and projected a transient IDLE. This fired an idle event with the reply of
the previous turn. Restore the suspended-turn fact on relaunch when the
snapshot holds a pending step, mark the drain window as in progress, and
fan out an IDLE event only when the conversation advanced since the last
one.

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Wait for the call-payload log as well as the selection span before rebuilding
an ID. The channels are batched independently, so checking as soon as the span
appeared made the parked regression timing-dependent. Unskip the array-member
case and update the design note with the corrected diagnosis.

Signed-off-by: Alex Suraci <[email protected]>
Keep call payload recording best-effort when a query has no route-scoped
delivery store. Split the test span and payload stores so each exercises the
interface and claim semantics used in production.

Signed-off-by: Alex Suraci <[email protected]>
Pass result types through direct digest lookup tests and account for the typed
structural-input projection retained by persistence snapshots.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the llm-workspace-dev-env branch from 78bbbfc to 93a8520 Compare August 28, 2026 20:47
vito added a commit to vito/dagger that referenced this pull request Sep 11, 2026
Directory.withPatch runs `git apply` in the mounted tree, and git looks
for a repository even though patching a working tree needs none. When the
tree contains a copied `git worktree` checkout, its .git is a FILE naming
a gitdir on the developer's machine — a path that doesn't exist inside
the engine — so every patch against such a tree died during repository
discovery with "fatal: not a git repository" before the patch was even
parsed. Discovery could also resolve a repo the sandbox shouldn't see,
and config from an embedded repo (core.autocrlf, core.fileMode, …) could
change the result. Pointing GIT_DIR at a nonexistent path skips
discovery entirely and keeps patching hermetic.

The failure also surfaced as a bare "git apply: exit status 128", which
callers several layers up (e.g. parallel changeset merges) show verbatim
— true, and useless. git's own output is now teed into a bounded buffer
and folded into the returned error, and when git names a patch line
("corrupt patch at <stdin>:5") the surrounding patch lines are quoted
with line numbers.

Extracted from the agent dev-env branch (dagger#13838).

Signed-off-by: Alex Suraci <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

vito added a commit to vito/dagger that referenced this pull request Sep 14, 2026
Directory.withPatch runs `git apply` in the mounted tree, and git looks
for a repository even though patching a working tree needs none. When the
tree contains a copied `git worktree` checkout, its .git is a FILE naming
a gitdir on the developer's machine — a path that doesn't exist inside
the engine — so every patch against such a tree died during repository
discovery with "fatal: not a git repository" before the patch was even
parsed. Discovery could also resolve a repo the sandbox shouldn't see,
and config from an embedded repo (core.autocrlf, core.fileMode, …) could
change the result. Pointing GIT_DIR at a nonexistent path skips
discovery entirely and keeps patching hermetic.

The failure also surfaced as a bare "git apply: exit status 128", which
callers several layers up (e.g. parallel changeset merges) show verbatim
— true, and useless. git's own output is now teed into a bounded buffer
and folded into the returned error, and when git names a patch line
("corrupt patch at <stdin>:5") the surrounding patch lines are quoted
with line numbers.

Extracted from the agent dev-env branch (dagger#13838).

Signed-off-by: Alex Suraci <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Sep 19, 2026
@vito vito reopened this Nov 24, 2026
@vito vito removed the kind/stale label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant