Skip to content

Guard spawn agent activity labels#454

Draft
itkonen wants to merge 4 commits intoeditor-code-assistant:masterfrom
itkonen:fix/spawn-agent-activity-label
Draft

Guard spawn agent activity labels#454
itkonen wants to merge 4 commits intoeditor-code-assistant:masterfrom
itkonen:fix/spawn-agent-activity-label

Conversation

@itkonen
Copy link
Copy Markdown
Contributor

@itkonen itkonen commented May 8, 2026

Sometimes Codex provides sub-agent activity labels that are extremely long, nonsensical, or repeat the same text over and over. This bloats the dialogue and can also pollute the tool-call history that later model turns may see. This PR adds a small guardrail to prevent that issue.


The summary below was generated by AI.

  • I added a entry in changelog under unreleased section.
  • This is not an AI slop.

Summary

  • Normalize spawn_agent activity arguments by trimming, collapsing whitespace, truncating overly long labels, and omitting blank or non-string labels.
  • Apply normalization before pre-tool-call hooks and again after hook-modified arguments so stored/replayed tool-call arguments stay clean.
  • Format subagent summaries without a trailing activity suffix when the activity is omitted.

Verification

  • clojure -M:test --focus eca.features.tools.agent-test
  • clj-kondo --lint src/eca/features/tools/agent.clj src/eca/features/chat/tool_calls.clj test/eca/features/tools/agent_test.clj

itkonen and others added 4 commits May 8, 2026 17:54
Normalize model-generated spawn_agent activity labels before they are displayed, stored, or replayed so pathological labels do not leak into UI or downstream context.

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
The PR check failed on macOS while the spawn handler had already reached completion output. Keep the regression coverage but allow more time for the end-to-end chat/prompt path and include state details if it times out.

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
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