feat: automatic solve option forwarding from hive config (issue #1209)#1210
feat: automatic solve option forwarding from hive config (issue #1209)#1210
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1209
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>
This reverts commit 9c4059a.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
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? |
|
🤖 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. |
…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>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
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_OVERRIDESwithout any manual code changes. This directly addresses the reviewer feedback:Architecture
SOLVE_OPTION_DEFINITIONS(new export fromsolve.config.lib.mjs) — single source of truth for all solve option definitions as a plain data objecthive.config.lib.mjs— auto-registers all solve options by looping overSOLVE_OPTION_DEFINITIONS, minus hive-only options (monitor-tag,all-issues, etc.) and solve-only options (resume,working-directory, etc.)hive.mjs— replaces 50+ individual if statements with a generic forwarding loop that auto-forwards options based on their type metadataHow it works
When a new option is added to
SOLVE_OPTION_DEFINITIONSinsolve.config.lib.mjs:hive.config.lib.mjs)hive.mjs)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)
--getkeep-fileinstead of--gitkeep-file(correctly rejected)Files Changed
src/solve.config.lib.mjsSOLVE_OPTION_DEFINITIONSas shared data structuresrc/hive.config.lib.mjs.option()calls)src/hive.mjstests/test-hive-solve-option-parity.mjsdocs/case-studies/issue-1209/README.md.changeset/auto-solve-option-forwarding.mdNet effect: -200 lines of code, zero manual maintenance needed for new options
Test plan
🤖 Generated with Claude Code