Skip to content

feat: parse dispatch labels from issue into session metadata#258

Open
alexgarden-mnemom wants to merge 1 commit intoComposioHQ:mainfrom
mnemom:feat/dispatch-label-parsing
Open

feat: parse dispatch labels from issue into session metadata#258
alexgarden-mnemom wants to merge 1 commit intoComposioHQ:mainfrom
mnemom:feat/dispatch-label-parsing

Conversation

@alexgarden-mnemom
Copy link

Summary

  • Parse dispatch:, mode:, and model: prefixed labels from issue labels into session metadata
  • Add metadata?: Record<string, string> to AgentLaunchConfig for downstream use by agent plugins
  • First occurrence wins when duplicate prefixes exist
  • 8 unit tests covering all prefixes, empty labels, and dedup

Motivation

This enables orchestrators to use issue labels for dispatch routing (single vs team agents), execution mode selection (plan-first vs direct), and per-issue model overrides — without requiring config changes for each issue.

Changes

File Change
packages/core/src/types.ts Add metadata field to AgentLaunchConfig
packages/core/src/session-manager.ts Add parseDispatchLabels(), wire into spawn()
packages/core/src/index.ts Export parseDispatchLabels
packages/core/src/__tests__/label-parser.test.ts 8 new tests

Test plan

  • All 8 label parser tests pass
  • All 81 existing session-manager tests pass unchanged
  • Full test suite passes (156 tests)

🤖 Generated with Claude Code

Add parseDispatchLabels() to extract dispatch:, mode:, and model: prefixed
labels from Linear/GitHub issues. First occurrence wins for dedup. Labels are
stored in AgentLaunchConfig.metadata and passed through to agent plugins.

- Add metadata?: Record<string, string> to AgentLaunchConfig (types.ts)
- Export parseDispatchLabels from @composio/ao-core
- Wire label parsing into spawn() after issue resolution
- 8 unit tests covering all prefixes, empty labels, and dedup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}
}
return result;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata values redundantly include their own prefix

High Severity

parseDispatchLabels stores the full label string (e.g. "model:sonnet") as the value rather than extracting just the part after the colon ("sonnet"). This means metadata.model is "model:sonnet" instead of "sonnet", making the value unusable as a direct model name for per-issue model overrides or as a dispatch route key. Downstream consumers would need to redundantly strip the prefix that the key already represents. The tests assert this buggy behavior.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

2 participants