Skip to content

fix(runtime): bound agent output projections - #1597

Merged
likun666661 merged 2 commits into
mainfrom
agent/1593-bound-agent-output
Jul 29, 2026
Merged

likun666661 merged 2 commits into
mainfrom
agent/1593-bound-agent-output

Conversation

@likun666661

Copy link
Copy Markdown
Member

What changed

  • add explicit agent_output views so callers do not receive AgentRun and RuntimeEvent streams together by default
  • enforce a 32 KiB default / 128 KiB maximum serialized payload budget across events, runtime events, diagnostics, and artifact references
  • expose truncation and budget diagnostics in the tool result
  • change the Graph supervisor prompt from max_events: 100 to a bounded 20-event, 32 KiB runtime-event inspection

Why

Issue #1593 reproduced Graph supervisor context overflow after four agent_output calls returned roughly 479–572 KiB each. The tool only bounded event count, not serialized size, and duplicated two event projections into the root session.

This is PR 1 of 4 in the Graph context-overflow repair stack.

Impact

Raw child execution history remains durable and inspectable through explicit views, while normal Graph supervision receives a bounded semantic projection.

Validation

  • npm --workspace @maka/runtime run typecheck
  • npm --workspace @maka/runtime run build
  • targeted SessionManager agent-output tests: 4/4
  • Graph/subagent tool tests: 27/27
  • git diff --check

The full SessionManager file also exposed an unrelated pre-existing timing-sensitive test failure; the affected agent-output subset passes independently.

@likun666661
likun666661 marked this pull request as ready for review July 29, 2026 12:25
@likun666661
likun666661 merged commit ff8685f into main Jul 29, 2026
3 checks passed
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