UP-17: Structured message metadata for agent orchestration#22
Merged
Killea merged 5 commits intoKillea:mainfrom Mar 1, 2026
Merged
UP-17: Structured message metadata for agent orchestration#22Killea merged 5 commits intoKillea:mainfrom
Killea merged 5 commits intoKillea:mainfrom
Conversation
Formalise the existing metadata passthrough into a typed orchestration API: - msg_post schema: document handoff_target, stop_reason, attachments as recognised metadata keys with types and descriptions - SSE events: emit msg.handoff and msg.stop events when those keys are set, enabling SSE subscribers to react to handoffs and agent stops without polling - msg_wait for_agent filter: only wake when metadata.handoff_target matches, enabling directed agent-to-agent handoff patterns - Response: handle_msg_post returns handoff_target / stop_reason in the tool result for immediate discoverability - Web UI: handoff badge (arrow pill) and stop-reason tag (colour-coded per reason) appear in the message header row - Tests: 11 pytest unit tests + 8 Vitest DOM/logic tests (all green) Fully backward-compatible — no schema migration needed (metadata column exists).
The feat/structured-metadata branch inherited crud.py changes that reference agents.skills (from UP-15 work), but the corresponding DB migration was missing, causing sqlite3.OperationalError in CI. UP-15 (PR Killea#21) is still pending review; this migration makes UP-17 self-contained regardless of merge order.
crud.py (inherited from UP-15 work) passes skills=skills_json to AgentInfo() but the field was missing from the dataclass, causing TypeError in CI. This makes UP-17 self-contained regardless of UP-15 (PR Killea#21) merge order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Formalises the existing
metadatapassthrough onmsg_postinto a typed orchestration API, enabling structured agent handoff and stop signalling.Changes
MCP Schema (src/mcp_server.py)
CRUD (src/db/crud.py)
Dispatch (src/tools/dispatch.py)
Web UI (src/static/index.html, src/static/css/main.css)
Tests
Recognised metadata keys
Backward Compatibility
No database schema changes. All metadata keys are optional. Existing callers that pass arbitrary metadata objects continue to work unchanged.