Skip to content

feat(config): add useSSHIdentityFile user config option#338

Open
michael-webster wants to merge 2 commits into
mainfrom
webster/allow-ssh-key-use
Open

feat(config): add useSSHIdentityFile user config option#338
michael-webster wants to merge 2 commits into
mainfrom
webster/allow-ssh-key-use

Conversation

@michael-webster
Copy link
Copy Markdown
Contributor

Summary

  • Adds useSSHIdentityFile as a user config key, letting users opt in to using the default chunk SSH identity file (via sidecar.DefaultKeyPath()) when opening SSH sessions to sidecars, instead of relying on SSH_AUTH_SOCK
  • Surfaces UseSSHIdentityFile through ResolvedConfig so config show displays it consistently alongside other fields
  • Fixes silent error handling: surfaces DefaultKeyPath() failures as warnings and removes a misleading warning: print that preceded a hard-error return

Test plan

  • chunk config set useSSHIdentityFile true / false — verify accepted values and error on invalid input
  • chunk config show — verify useSSHIdentityFile appears in output
  • chunk validate with useSSHIdentityFile=true and no identity file present — verify warning is printed and SSH falls back to auth sock behavior
  • go test -race ./internal/cmd/... ./internal/config/...

🤖 Generated with Claude Code

webster and others added 2 commits May 15, 2026 12:57
Long-running Claude sessions would get stuck waiting on SSH_AUTH_SOCK
approval prompts for each sidecar connection. Add a user-settable
boolean (chunk config set useSSHIdentityFile true) that prefers the
default chunk identity file (~/.ssh/chunk_ai) over the SSH agent,
avoiding repeated auth prompts in hook context.

Also print a warning when remote validate commands fail silently so the
error is visible rather than just causing an unexplained exit code 2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… errors

- Add UseSSHIdentityFile to ResolvedConfig so config show reuses the
  already-loaded config rather than calling config.Load() a second time
  with a silently swallowed error
- Surface DefaultKeyPath() error as a warning instead of discarding it
  when useSSHIdentityFile is set
- Remove misleading warning: print before remote run errors that are
  already returned as hard failures to the caller

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@michael-webster michael-webster marked this pull request as ready for review May 18, 2026 16:01
@schurchleycci
Copy link
Copy Markdown
Contributor

A few things from Claude:

config show --json silently omits useSSHIdentityFile

The configOutput struct in newConfigShowCmd wasn't updated — only the text output path was. Any tooling parsing --json output won't see this field. Needs UseSSHIdentityFile bool added to the struct and populated from rc.UseSSHIdentityFile.

Column alignment broken in config show text output

w := 15 but useSSHIdentityFile: is 19 characters, so it overflows and misaligns everything. w := 20 fixes it.

Missing test coverage

The test plan describes manual steps but the automated tests don't cover the new paths:

  • TestValidConfigKeys in config_test.go wasn't updated — useSSHIdentityFile isn't asserted as a valid key
  • No tests for config set boolean validation (accepting true/1/false/0, rejecting "yes", "maybe", etc.)
  • No tests for the identity file resolution in openSSHSession — neither the UseSSHIdentityFile=true path nor the SSH_AUTH_SOCK fallback

@schurchleycci
Copy link
Copy Markdown
Contributor

This looks good aside from the above comment 👍

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