feat(task-messages): add optional agent_path to TaskMessage - #381
feat(task-messages): add optional agent_path to TaskMessage#381vkalmathscale wants to merge 1 commit into
Conversation
Streamed task-message events carry only a task_id, so events emitted by multiple agents into a single task stream cannot be attributed to their source. Add an optional agent_path to the TaskMessage schema — a single agent id, or a root-to-emitter path for nested agents sharing one stream. Stream events already carry it via parent_task_message, so TaskMessage is the right OpenAPI surface for per-agent attribution. Additive and backward-compatible (optional, defaults to null); stream-only, so no entity/storage change. Regenerated openapi.yaml via make gen-openapi. The generated Python SDK (scale-agentex-python) picks this up via the automated Stainless flow; the runtime that stamps agent_path lands in scale-agentex-python#474.
✱ Stainless preview buildsThis PR will update the openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ agentex-sdk-typescript studio · code · diff
✅ agentex-sdk-openapi studio · code · diff
✅ agentex-sdk-python studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
What
Add an optional
agent_pathfield to theTaskMessageAPI schema (agentex/src/api/schemas/task_messages.py) and regenerateopenapi.yaml.agent_pathisstr | list[str] | None: a single agent id, or a root-to-emitter path (for example,["researcher", "subagent-abc"]) for nested agents that share one task stream.Why
Streamed task-message events currently carry only a
task_id, so when multiple agents emit into a single task stream their events cannot be attributed to the emitting agent. Stream events already reference the message viaparent_task_message: TaskMessage, soTaskMessageis the correct OpenAPI surface to carry the source. Consumers can then group and filter streamed events by agent.Scope
openapi.yamlonly.null).TaskMessageEntity, storage, or migration change.Paired SDK PR and merge order
This is the root of a two-PR change; the generated Python SDK consumes this spec:
scale-agentex-pythonnext, addingagent_pathto the generatedTaskMessage.agent_pathonto the in-memory envelope before emittingstart/delta/full/done, is rebased to drop its temporary manual patch and rely on the regenerated field.Verification
make gen-openapiregenerated the spec; the pre-commit "Regenerate AgentEx OpenAPI spec" hook passed (spec in sync), and ruff and ruff-format passed. Diff is the new field only (+21, no deletions).Generated with Claude Code