Skip to content

feat: automatic solve option forwarding from hive config (issue #1209)#1210

Open
konard wants to merge 8 commits intomainfrom
issue-1209-d6171572e78f
Open

feat: automatic solve option forwarding from hive config (issue #1209)#1210
konard wants to merge 8 commits intomainfrom
issue-1209-d6171572e78f

Conversation

@konard
Copy link
Contributor

@konard konard commented Feb 1, 2026

Summary

Fixes #1209

Refactored hive-to-solve option forwarding to be fully automatic. New solve options are now automatically available in hive and TELEGRAM_HIVE_OVERRIDES without any manual code changes. This directly addresses the reviewer feedback:

"Can we do something so we don't need to add if statement for each option of solve command? Can we exclude hive command options from all solve command options, and just support passing them all? So this file will never need manual change again in the future?"

Architecture

  1. SOLVE_OPTION_DEFINITIONS (new export from solve.config.lib.mjs) — single source of truth for all solve option definitions as a plain data object
  2. hive.config.lib.mjs — auto-registers all solve options by looping over SOLVE_OPTION_DEFINITIONS, minus hive-only options (monitor-tag, all-issues, etc.) and solve-only options (resume, working-directory, etc.)
  3. hive.mjs — replaces 50+ individual if statements with a generic forwarding loop that auto-forwards options based on their type metadata

How it works

When a new option is added to SOLVE_OPTION_DEFINITIONS in solve.config.lib.mjs:

  • It is automatically accepted by hive's yargs parser (no change needed in hive.config.lib.mjs)
  • It is automatically forwarded from hive to solve (no change needed in hive.mjs)
  • It is automatically valid in TELEGRAM_HIVE_OVERRIDES (no change needed anywhere)

Only three small sets need maintenance:

  • HIVE_ONLY_OPTION_NAMES — options unique to hive (e.g., monitor-tag, concurrency)
  • SOLVE_ONLY_OPTION_NAMES — options internal to solve (e.g., resume, session-type)
  • HIVE_CUSTOM_SOLVE_OPTIONS — options where hive needs different defaults/descriptions than solve (e.g., model, dry-run, auto-cleanup)

Root Cause (original issue)

  1. User typo: --getkeep-file instead of --gitkeep-file (correctly rejected)
  2. Architectural gap: Many solve options were manually duplicated across files, leading to drift and missing options

Files Changed

File Changes
src/solve.config.lib.mjs Extract SOLVE_OPTION_DEFINITIONS as shared data structure
src/hive.config.lib.mjs Auto-register solve options via loop (removed 25+ manual .option() calls)
src/hive.mjs Generic forwarding loop (removed 50+ manual if statements)
tests/test-hive-solve-option-parity.mjs Updated to use actual module exports instead of regex
docs/case-studies/issue-1209/README.md Fixed prettier formatting
.changeset/auto-solve-option-forwarding.md Changeset for release

Net effect: -200 lines of code, zero manual maintenance needed for new options

Test plan

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #1209
@konard konard self-assigned this Feb 1, 2026
konard and others added 4 commits February 2, 2026 00:50
Documents root cause analysis of the "Unknown arguments: getkeep-file"
error, including the user typo (getkeep vs gitkeep) and the systemic
architectural gap where solve options aren't fully forwarded through
hive and telegram bot overrides.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…warding

- Add 25+ solve-passthrough options to hive.config.lib.mjs so they can
  be used in TELEGRAM_HIVE_OVERRIDES without validation errors
- Add forwarding for all new options in hive.mjs args builder
- Fix missing forwarding for existing options: prompt-general-purpose-sub-agent,
  tokens-budget-stats, prompt-check-sibling-pull-requests, prompt-architecture-care
- Fix --target-branch to --base-branch mapping (solve uses --base-branch)
- Add missing option names to KNOWN_OPTION_NAMES for better error suggestions

Fixes #1209

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test-issue-1209-overrides.mjs: Integration tests verifying
  --gitkeep-file and other solve options work in TELEGRAM_SOLVE_OVERRIDES
  and TELEGRAM_HIVE_OVERRIDES via --dry-run mode
- Add test-hive-solve-option-parity.mjs: Unit test ensuring all solve
  options are defined in hive config (prevents future regressions)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Invalid solve-overrides: Unknown arguments: getkeep-file, getkeepFile feat: add solve-passthrough options to hive config and fix option forwarding (issue #1209) Feb 1, 2026
@konard konard marked this pull request as ready for review February 1, 2026 23:58
@konard
Copy link
Contributor Author

konard commented Feb 1, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $6.499125 USD
  • Calculated by Anthropic: $5.056906 USD
  • Difference: $-1.442220 (-22.19%)
    📎 Log file uploaded as Gist (1188KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Feb 2, 2026

Can we do something so we don't need to add if statement for each option of solve command? Can we exclude hive command options from all solve command options, and just support passing them all? So this file will never need manual change again in the future?

@konard konard marked this pull request as draft February 2, 2026 19:59
@konard
Copy link
Contributor Author

konard commented Feb 2, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-02-02T19:59:34.546Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

konard and others added 2 commits February 2, 2026 21:01
…1209)

Refactored hive-to-solve option forwarding to be fully automatic.
New solve options added to SOLVE_OPTION_DEFINITIONS are now
automatically available in hive and TELEGRAM_HIVE_OVERRIDES without
any manual code changes to hive.config.lib.mjs or hive.mjs.

- Extract SOLVE_OPTION_DEFINITIONS from solve.config.lib.mjs as shared data
- hive.config.lib.mjs auto-registers all solve options via loop
- hive.mjs replaces 50+ if statements with generic forwarding loop
- Export getSolvePassthroughOptionNames() for programmatic access
- Update parity test to use actual module exports instead of regex

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title feat: add solve-passthrough options to hive config and fix option forwarding (issue #1209) feat: automatic solve option forwarding from hive config (issue #1209) Feb 2, 2026
@konard konard marked this pull request as ready for review February 2, 2026 20:12
@konard
Copy link
Contributor Author

konard commented Feb 2, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $8.597284 USD
  • Calculated by Anthropic: $5.843362 USD
  • Difference: $-2.753923 (-32.03%)
    📎 Log file uploaded as Gist (1474KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

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.

Invalid solve-overrides: Unknown arguments: getkeep-file, getkeepFile

1 participant