awslabs / awslabs/cli-agent-orchestrator

feat: auto-inject sender terminal ID in assign and send_message

Open
#70 8 comments 0 reactions 1 assignee Claimed by @sriharshaarangi View on GitHub
enhancement
Dominant language
Python
Stars
1.3k
Forks
267
Avg merge
1d 23h
Merged PRs (30d)
70

Description

## Problem

In multi-agent workflows, the receiving agent needs to know the sender's terminal ID to send results back. Today this relies on:

1. **Tool docstrings** instructing the LLM to read `CAO_TERMINAL_ID` from its environment and include it in the message — but LLMs don't reliably follow these instructions
2. **Human prompt engineering** — users have to explicitly add "find your terminal ID and include it" in every agent profile/system prompt, and even then there's no guarantee the LLM will do it consistently
3. **Manual inclusion** — the sending agent must look up its own terminal ID and embed callback instructions in every assign/send_message call

This makes multi-agent callback unreliable. It's boilerplate that every prompt author has to repeat, and it still fails when the LLM ignores or misinterprets the instructions. The problem should be solved at the orchestrator level, not left to prompt engineering.

## Proposed Solution

Auto-inject sender terminal ID as a message suffix at the CAO level, gated behind `CAO_ENABLE_SENDER_ID_INJECTION` (opt-in, defaults to `false`). Based on feedback, this can be enabled by default in a future release.

- **assign**: appends `[Assigned by terminal X. When done, send results back to terminal X using send_message]`
- **send_message / inbox delivery**: appends `[Message from terminal X]` when delivering queued messages
- Suffix (not prefix) to avoid breaking tools that parse message start (e.g., `@agent-sop`)
- Tool docstrings updated conditionally — simplified when injection is enabled, manual instructions when disabled

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.