Skip to content

feat(poll-loop): per-message reasoning-effort routing for heavy commands#2406

Open
matt1995ai wants to merge 1 commit into
nanocoai:mainfrom
matt1995ai:sentinel/feat/per-message-effort-routing
Open

feat(poll-loop): per-message reasoning-effort routing for heavy commands#2406
matt1995ai wants to merge 1 commit into
nanocoai:mainfrom
matt1995ai:sentinel/feat/per-message-effort-routing

Conversation

@matt1995ai
Copy link
Copy Markdown

Until now each container ran with one static effort (config.ts → claude.ts:302), which forced an all-or-nothing choice: max for every reply (wasteful on quick chat) or a lower default that under-served the genuinely heavy turns — multi-agent council synthesis, deliberate reasoning runs, multi-file build orchestration.

This adds a per-query override path:

  • QueryInput.effortOverride: optional, plumbed from poll-loop to provider
  • ClaudeProvider.query uses input.effortOverride ?? this.effort
  • detectEffortOverride() in poll-loop scans the current batch and returns 'max' if any message is a heavy slash command (/council, /build, /think)

Default behavior is unchanged: turns with no heavy command fall through to the group's configured effort. Other providers (mock) ignore the new field since they don't consult SDK effort.

Includes 8 unit tests covering the helper.

Type of Change

  • Feature skill - adds a channel or integration (source code changes + SKILL.md)
  • Utility skill - adds a standalone tool (code files in .claude/skills/<name>/, no source changes)
  • Operational/container skill - adds a workflow or agent skill (SKILL.md only, no source changes)
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code
  • Documentation - docs, README, or CONTRIBUTING changes only

Description

For Skills

  • SKILL.md contains instructions, not inline code (code goes in separate files)
  • SKILL.md is under 500 lines
  • I tested this skill on a fresh clone

Until now each container ran with one static `effort` (config.ts → claude.ts:302),
which forced an all-or-nothing choice: max for every reply (wasteful on quick
chat) or a lower default that under-served the genuinely heavy turns —
multi-agent council synthesis, deliberate reasoning runs, multi-file build
orchestration.

This adds a per-query override path:
  - QueryInput.effortOverride: optional, plumbed from poll-loop to provider
  - ClaudeProvider.query uses `input.effortOverride ?? this.effort`
  - detectEffortOverride() in poll-loop scans the current batch and returns
    'max' if any message is a heavy slash command (/council, /build, /think)

Default behavior is unchanged: turns with no heavy command fall through to
the group's configured effort. Other providers (mock) ignore the new field
since they don't consult SDK effort.

Includes 8 unit tests covering the helper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follows-guidelines PR was created using the current contributing template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant