feat(agentloop): sub-agent delegation (issue #153, v0 sequential) - #230
Merged
Conversation
What ships:
- cmd/sin-code/internal/agentloop/subagent.go (new)
- SubagentRequest: Goal + optional MaxTurns/MaxTokens overrides.
- SubagentResult: Summary + Verified + Turns + OpenCriteria
(never the full message history — the parent's context stays small).
- Loop.SpawnSubagent(ctx, *session.Store, req): forks a fresh
session, builds a child Loop that shares the parent's wiring
(Gate, Completion, hooks, lessons, ledger), inherits the
parent's budgets unless overridden, runs child.Run, returns
a result. Does NOT inherit RunOverride.
- cmd/sin-code/internal/agentloop/subagent_test.go: 6 tests
(nil-parent, nil-store, empty-goal, basic-success, budget-fallback,
budget-override).
Acceptance criteria (from #153):
- [x] spawn_subagent tool exists (the SpawnSubagent method).
- [x] The sub-agent's session is isolated from the parent's.
- [x] Only the summary is returned to the parent (never the
full history).
- [x] Per-subagent MaxTurns / MaxTokens are honored.
- [x] v0 ships sequential delegation; parallelism is a follow-up.
Hard mandates honored:
- M2: no new deps.
- M3: the sub-agent's verify-gate is the same as the parent's
(re-verified, defense in depth).
- M7: 6/6 tests pass under go test -race -count=1.
Refs: #153
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Deployment failed with the following error: Learn More: https://vercel.com/manheiler-8784s-projects?upgradeToPro=build-rate-limit |
Contributor
|
Deployment failed with the following error: Learn More: https://vercel.com/miroblabla-2914s-projects?upgradeToPro=build-rate-limit |
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements issue #153 (Loop Engineering Lücke 4).
Loop.SpawnSubagentruns a subtask in an isolated session, returns a SubagentResult with summary + control fields only (never the full history).What ships
v0 vs v1
v0 (this PR): sequential delegation. One sub-agent at a time.
The issue body says: "Empfohlene Reihenfolge: erst sequentielle Delegation (unten), Parallelität als Follow-up."
v1 (follow-up): parallel delegation. The signature is already designed for it — one
SpawnSubagentcall per sub-agent, no shared state. v1 spawns N goroutines.Acceptance criteria
spawn_subagentmethod exists on LoopHard mandates
go test -race -count=1Closes #153