Add option to skip bare mode (avoid try-then-fallback overhead) - #1029
Add option to skip bare mode (avoid try-then-fallback overhead)#1029acreeger wants to merge 4 commits into
Conversation
Analysis: Skip Bare Mode Option (#1028)Problem StatementWhen Claude CLI's Root CauseThe bare mode auto-apply logic lives in // Auto-apply bare mode for headless utility operations when not explicitly set
if (bare === undefined && headless && noSessionPersistence) {
const config = await resolveBareModeConfig()
effectiveBare = config.bare
effectiveSettings ??= config.settings
oauthToken = config.oauthToken
bareModeAutoApplied = config.bare
}When bare mode is auto-applied and fails, the retry loop (lines 407–468) retries without The decision function
For Enterprise accounts with OAuth tokens, path 2 triggers bare mode, but Affected ComponentsPrimary:
|
| File | Line | Operation | Settings Access |
|---|---|---|---|
src/lib/CommitManager.ts |
364, 372 | Commit message generation | Has getLogger(), needs settings |
src/lib/SessionSummaryService.ts |
89–96, 279–281 | Session summary generation | Constructor-injected |
src/lib/IssueEnhancementService.ts |
114–118, 254–258 | Issue enhancement | Constructor-injected |
src/lib/ValidationRunner.ts |
416–419 | Validation (jsonStream mode) | Receives settings |
src/utils/claude.ts |
743 | generateBranchName() |
Standalone function |
Documentation
docs/iloom-commands.md: Document the newskipBareModesetting.
Design Considerations
Approach: Settings-driven with ClaudeCliOptions passthrough
The cleanest approach adds skipBareMode at two levels:
-
Settings schema (
IloomSettingsSchema.skipBareMode): Users set this once in their.iloom/settings.jsonor~/.config/iloom-ai/settings.json. -
ClaudeCliOptions.skipBareMode: Callers that have settings access pass this through.launchClaude()checks it before entering the auto-apply block. -
resolveBareModeConfig(): Accepts an optional{ skipBareMode?: boolean }parameter — iftrue, returns{ bare: false }immediately.
Why not an environment variable?
An env var would be simpler (no caller changes), but goes against the existing settings pattern. All other iloom configuration uses the SettingsManager hierarchy. Consistency matters.
Propagation to callers
Most callers (CommitManager, SessionSummaryService, IssueEnhancementService, ValidationRunner) are services with constructor-injected dependencies. They already receive or can receive settings. The standalone generateBranchName() function is the exception — it would need either a parameter addition or access to settings.
Questions / Assumptions
| # | Question | Assumed Answer |
|---|---|---|
| 1 | Setting name: skipBareMode vs disableBareMode vs bare.skip? |
skipBareMode — matches the issue title language and is a simple boolean at the top level |
| 2 | Should this also affect explicit bare: true calls? |
No — only affects the auto-apply path. If a caller explicitly sets bare: true, respect that. |
| 3 | Should there be a CLI flag --skip-bare-mode on individual commands? |
Not initially — this is a persistent config. Users set it once and forget. CLI flag can be added later if needed. |
| 4 | Telemetry: should we track when this setting is active? | Yes — track in loom.created to understand adoption. |
Files Requiring Changes (Summary)
src/lib/SettingsManager.ts— AddskipBareModeto both schema variantssrc/utils/claude.ts— Add toClaudeCliOptions, modifyresolveBareModeConfig()andlaunchClaude()auto-apply logicsrc/lib/CommitManager.ts— PassskipBareModefrom settingssrc/lib/SessionSummaryService.ts— PassskipBareModefrom settingssrc/lib/IssueEnhancementService.ts— PassskipBareModefrom settingssrc/lib/ValidationRunner.ts— PassskipBareModefrom settingsdocs/iloom-commands.md— Document the new setting- Tests for the new behavior
Implementation Plan: Skip Bare Mode Option (#1028)OverviewAdd a Phase 1: Core Infrastructure (Settings +
|
Implementation CompleteSummaryAdded Changes Made
Validation Results
Detailed Changes by File (click to expand)src/lib/SettingsManager.tsChanges: Added setting definition
src/utils/claude.tsChanges: Core skip logic
src/lib/CommitManager.tsChanges: Caller propagation
src/lib/SessionSummaryService.tsChanges: Caller propagation
src/lib/IssueEnhancementService.tsChanges: Caller propagation
src/lib/ValidationRunner.tsChanges: Caller propagation
src/lib/BranchNamingService.tsChanges: Caller propagation
src/types/telemetry.tsChanges: Telemetry tracking
src/utils/claude.test.tsChanges: 3 new tests
docs/iloom-commands.mdChanges: Documentation
|
ca12269 to
b8f7fc5
Compare
Fixes #1028
Add option to skip bare mode (avoid try-then-fallback overhead)
Issue details
Summary
Requested by @NoahCardoza in #1022.
For accounts where bare mode is never compatible (e.g. Enterprise Accounts), iloom currently attempts bare mode first and falls back on every
start/commit/finish. This wastes time on each operation trying something that will always fail for these users.Proposal
Add a configuration option to skip bare mode entirely, so bare mode is never attempted and iloom goes straight to the working path. This avoids the per-operation try-then-fallback overhead.
Context
— @NoahCardoza (comment)
Follow-up to #1022, which added the graceful fallback (shipped in v0.14.2). This issue tracks letting users opt out of the bare-mode attempt altogether.
This PR was created automatically by iloom.