Skip to content

feat: Add maxAnnounceChars parameter to sessions_spawn #46785

@salvador-clawi

Description

@salvador-clawi

Problem

Sub-agent completion messages that exceed Telegram's 4096 character limit are silently dropped (related to upstream issue #28851 — sendPayload bypasses chunker).

The current mitigation is a protocol-level instruction in sub-agent prompts limiting output to ~3500 chars, but LLMs cannot reliably count characters, so this fails occasionally.

Proposed Feature

Add a maxAnnounceChars parameter to sessions_spawn that:

  1. Truncates the announce message at the specified length
  2. Appends a marker like [truncated — full output in transcript] so the recipient knows there is more

Example usage:

{ "maxAnnounceChars": 3500 }

Why This Is Better Than Protocol-Level Mitigation

  • Platform-level enforcement is deterministic; LLM instruction-following is not
  • Removes the character-counting burden from the sub-agent prompt
  • Consistent behavior regardless of model used

Priority

Low / nice-to-have. The protocol mitigation works but is fragile under complex outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions