Skip to content

fix(start): preflight agent launch setup#67

Open
michiosw wants to merge 1 commit intofeat/cli-auth-identityfrom
feat/cli-agent-preflight
Open

fix(start): preflight agent launch setup#67
michiosw wants to merge 1 commit intofeat/cli-auth-identityfrom
feat/cli-agent-preflight

Conversation

@michiosw
Copy link
Copy Markdown
Contributor

@michiosw michiosw commented Apr 16, 2026

Summary

  • Preflights the requested agent before auth, backend session creation, provider sync, or hosted connect.
  • Distinguishes unsupported agents, missing binaries, non-executable binaries, and agent process exits after setup.
  • Keeps downstream agent failures visible instead of silently forwarding only the exit code.

Why

If Claude is missing or cannot run, the CLI should say that before doing any auth or provider work. Developers get a faster failure and avoid creating managed sessions for a launch that was never possible.

Before / After Terminal Capture

Before, setup could run before discovering Claude was unavailable or invalid:

✓ Authenticated as dev@example.com
✓ Session: MacBookPro - kontext-cli (73ec64f7)
Resolving credentials...
Launching claude...
Error: agent "claude" not found in PATH: executable file not found

After, agent setup fails immediately:

Error: agent "claude" not found in PATH

For an agent that launches and exits early, the user gets Kontext context:

Launching claude...
Error: claude exited with code 1 after Kontext setup completed
✓ Session ended (73ec64f7)

Verification

  • Ran go test ./... on this branch.

Copy link
Copy Markdown
Contributor Author

michiosw commented Apr 16, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@michiosw michiosw force-pushed the feat/cli-agent-preflight branch from 81dc3e6 to 97d7ef9 Compare April 17, 2026 07:02
@michiosw michiosw force-pushed the feat/cli-auth-identity branch from 5f60603 to 6010307 Compare April 17, 2026 07:02
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@michiosw michiosw requested a review from tumberger April 17, 2026 07:08
@michiosw michiosw force-pushed the feat/cli-agent-preflight branch from 97d7ef9 to af1783e Compare April 17, 2026 07:12
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@michiosw michiosw force-pushed the feat/cli-agent-preflight branch from af1783e to abc4ea2 Compare April 17, 2026 07:22
Copy link
Copy Markdown
Contributor

@tumberger tumberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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