Repository navigation
feat(agent): surface team member StopError cause on team.* events (#331) - #403
Merged
Merged
Conversation
Mirror the #319 SubagentPayload.Cause design onto TeamPayload: a team member whose round ends in StopError now carries the loop's ResultPayload.Error on its per-round EvTeamMember (InnerKind=EvResult), normalised through the shared subagentCausePayload chokepoint (whitespace-collapsed, rune-clamped to 400) at the single emit site projectTeamEvent. Client-only (gauntlet #7 — harness/provider metadata, never member-authored output); the terminal EvTeamEnd disposition stays closed-enum and writeTeamStatus is unchanged. Threaded end-to-end: proto Team.cause (field 19) -> toProtoTeam -> ACP teamMemberLine ("<member> failed: <cause>") -> mecatui TeamMsg/teamLane -> the team focus pane's "failed:" block, rendered only for a member benched on error (last non-empty cause wins; a recovered done member renders nothing). The ADR-0079 trip-wire comment records the current state: the shared normaliser now crosses Subagent + Team, Parallel deliberately omits Cause, and the 4th-family ChildActivity extraction bar stands. Engine public surface: session.TeamPayload.Cause is Added (minor) per COMPATIBILITY.md — api/session.txt regenerated, CHANGELOG entry added. Co-Authored-By: mecatl <[email protected]>
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.
Summary
Closes #331. Mirrors the #319
SubagentPayload.Causedesign onto the team member path — the third delegation family the #319 fix explicitly left out of scope.A team member whose round ends in a run-level provider error (
StopError) had its real cause captured by the loop onsession.ResultPayload.Errorand then dropped at the projection. Now:session.TeamPayload.Causecarries the member run's per-round failure detail onEvTeamMember(InnerKind=EvResult) only when the round'sStopisStopError— harness/provider metadata, never member-authored output (gauntlet ACP: accept client-provided streaming-HTTP MCP servers #7, same footing asStop/Usage).projectTeamEvent(engine/agent/teamtool.go) via the sharedsubagentCausePayloadchokepoint (whitespace-collapsed, rune-clamped tomaxSubagentCausePreview= 400). No second normalisation path.Team.cause(field 19) →toProtoTeam→ ACPteamMemberLine(<member> failed: <cause>) → mecatuiTeamMsg.Cause→teamLane.cause→ the team focus pane'sfailed:block.Scoping decisions (from the architect's plan)
writeTeamStatus(the lead's trusted synthesis section) is unchanged — threading a provider error string into that region is a separate model-visible change with its own risk surface.EvTeamEnddisposition stays closed-enum (no cause onTeamMemberDisposition); a retried member's failed rounds each surface their own cause on the per-round result event.ChildActivityextraction: the ADR-0079 trip-wire fires at a 4th delegation family,ParallelPayloaddeliberately omitsCause, and the normalisation is already shared via the helper. The trip-wire comment is updated to record the current state.stopped — error; a verbose cause would break the roster width invariant — same fleet/focus split as A failed subagent's actual cause is dropped four times — the error shown is the child's last chat line #319).teamFailureLinewraps to the card text budget via the viewport width and is self-defensive (mirrorssubagentFailureLine's guards).Gates
task generate(proto regen) +task api:update(engine/api/session.txt) — done;session.TeamPayload.Causeclassified Added (minor) perengine/COMPATIBILITY.md, with theengine/CHANGELOG.mdentry.task lint && task test— green (root + engine + provider modules + standalone proofs; api-compat gate passes).task docs—llms.txtregenerated, strict link gate clean (0 broken/orphan/unreachable).go run ./cmd/mecademo— still prints a full offline session.Tests
New coverage at every seam, each failing if the cause is dropped at its layer: the real-supervisor-loop emit site (multi-line + 5000-rune adversarial error → collapsed, ≤401 runes, result-event-only),
projectTeamEventunit, the session reviewed-fields allow-list, the proto mapper, the ACP projector, the client msgs mapping, and the mecatui focus render (benched-on-error rendersfailed:; a done member and a non-error stop render nothing; last non-empty cause wins; the failure line wraps to the card budget).Review
Ran the dev-pipeline panel (spec / standards / domain: secure-code, software-architect, code-duplication, library-reuse + a QA test-adequacy pass). Cross-confirmed findings fixed before opening: the viewport width/height mix-up in
teamFailureLine, the helper's missing self-defensive guards, and the stalesubagentCausePayloaddoc-comment (now names both delegation families).