Skip to content

fix: credential detection and provider auth status#120

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-06-fix_fix_checking_if_provider_is_authenticated
Feb 7, 2026
Merged

fix: credential detection and provider auth status#120
graphite-app[bot] merged 1 commit intomainfrom
02-06-fix_fix_checking_if_provider_is_authenticated

Conversation

@NathanFlurry
Copy link
Member

@NathanFlurry NathanFlurry commented Feb 7, 2026

Summary

Fix credential detection bugs and add credential availability status to the API. Consolidate Claude fallback models and add sonnet alias.

Builds on #109 (OAuth token support).

Related issues:

Changes

Credential detection fixes

  • agent-credentials/src/lib.rs: Fix ? operator bug in extract_claude_credentials - now continues to next config path if one is missing instead of returning early

API credential status

  • sandbox-agent/src/router.rs: Add credentialsAvailable field to AgentInfo struct
  • /v1/agents endpoint now reports whether each agent has valid credentials

OpenCode provider improvements

  • sandbox-agent/src/opencode_compat.rs: Build connected array based on actual credential availability, not just model presence
  • Check provider-specific credentials for OpenCode groups (e.g., opencode:anthropic only connected if Anthropic creds available)
  • Add logging when credential extraction fails in model cache building

Fallback model consolidation

  • Renamed claude_oauth_fallback_models()claude_fallback_models() (used for all fallback cases, not just OAuth)
  • Added sonnet to fallback models (confirmed working via headless CLI test)
  • Added codex_fallback_models() for Codex when credentials missing
  • Added comment explaining aliases work for both API and OAuth users

Documentation

  • docs/credentials.mdx: New reference doc covering credential sources, extraction behavior, and error handling
  • Documents that extraction failures are silent (not errors)
  • Documents that agents spawn without credential pre-validation

Inspector UI

  • AgentsTab.tsx: Added credential status pill showing "Authenticated" or "No Credentials"

Error Handling Philosophy

  • Extraction failures are silent: Missing/malformed config files don't error, just continue to next source
  • Agents spawn without credential validation: No pre-flight auth check; agent's native error surfaces if credentials are missing
  • Fallback models for UI: When credentials missing, show alias-based models so users can still configure sessions

Validation

  • Tested Claude Code model aliases via headless CLI:
    • claude --model default --print "say hi"
    • claude --model sonnet --print "say hi"
    • claude --model haiku --print "say hi"
  • Build passes
  • TypeScript types regenerated with credentialsAvailable field

@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-120 February 7, 2026 04:11 Destroyed
@railway-app
Copy link

railway-app bot commented Feb 7, 2026

🚅 Deployed to the sandbox-agent-pr-120 environment in sandbox-agent

Service Status Web Updated (UTC)
website ✅ Success (View Logs) Web Feb 7, 2026 at 7:56 am

@NathanFlurry NathanFlurry force-pushed the 02-06-fix_fix_checking_if_provider_is_authenticated branch from 1c372bc to 53ec13f Compare February 7, 2026 04:18
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-120 February 7, 2026 04:18 Destroyed
Copy link
Member Author

NathanFlurry commented Feb 7, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@claude
Copy link

claude bot commented Feb 7, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@NathanFlurry NathanFlurry force-pushed the 02-06-fix_fix_checking_if_provider_is_authenticated branch from 53ec13f to 50bb7c3 Compare February 7, 2026 06:59
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-120 February 7, 2026 06:59 Destroyed
@NathanFlurry NathanFlurry force-pushed the 02-06-fix_fix_checking_if_provider_is_authenticated branch from 50bb7c3 to bc7010d Compare February 7, 2026 07:55
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-120 February 7, 2026 07:55 Destroyed
@graphite-app
Copy link

graphite-app bot commented Feb 7, 2026

Merge activity

## Summary

Fix credential detection bugs and add credential availability status to the API. Consolidate Claude fallback models and add `sonnet` alias.

Builds on #109 (OAuth token support).

Related issues:
- Fixes #117 (Claude, Codex not showing up in gigacode)
- Related to #113 (Default agent should be Claude Code)

## Changes

### Credential detection fixes
- **`agent-credentials/src/lib.rs`**: Fix `?` operator bug in `extract_claude_credentials` - now continues to next config path if one is missing instead of returning early

### API credential status
- **`sandbox-agent/src/router.rs`**: Add `credentialsAvailable` field to `AgentInfo` struct
- **`/v1/agents`** endpoint now reports whether each agent has valid credentials

### OpenCode provider improvements
- **`sandbox-agent/src/opencode_compat.rs`**: Build `connected` array based on actual credential availability, not just model presence
- Check provider-specific credentials for OpenCode groups (e.g., `opencode:anthropic` only connected if Anthropic creds available)
- Add logging when credential extraction fails in model cache building

### Fallback model consolidation
- Renamed `claude_oauth_fallback_models()` → `claude_fallback_models()` (used for all fallback cases, not just OAuth)
- Added `sonnet` to fallback models (confirmed working via headless CLI test)
- Added `codex_fallback_models()` for Codex when credentials missing
- Added comment explaining aliases work for both API and OAuth users

### Documentation
- **`docs/credentials.mdx`**: New reference doc covering credential sources, extraction behavior, and error handling
- Documents that extraction failures are silent (not errors)
- Documents that agents spawn without credential pre-validation

### Inspector UI
- **`AgentsTab.tsx`**: Added credential status pill showing "Authenticated" or "No Credentials"

## Error Handling Philosophy

- **Extraction failures are silent**: Missing/malformed config files don't error, just continue to next source
- **Agents spawn without credential validation**: No pre-flight auth check; agent's native error surfaces if credentials are missing
- **Fallback models for UI**: When credentials missing, show alias-based models so users can still configure sessions

## Validation

- Tested Claude Code model aliases via headless CLI:
  - `claude --model default --print "say hi"` ✓
  - `claude --model sonnet --print "say hi"` ✓
  - `claude --model haiku --print "say hi"` ✓
- Build passes
- TypeScript types regenerated with `credentialsAvailable` field
@graphite-app graphite-app bot force-pushed the 02-06-fix_fix_checking_if_provider_is_authenticated branch from bc7010d to c54f83e Compare February 7, 2026 07:56
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-120 February 7, 2026 07:56 Destroyed
@graphite-app graphite-app bot merged commit c54f83e into main Feb 7, 2026
3 of 5 checks passed
@railway-app railway-app bot temporarily deployed to sandbox-agent / production February 7, 2026 07:58 Inactive
@railway-app railway-app bot temporarily deployed to sandbox-agent / preview February 7, 2026 07:58 Inactive
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.

Claude, Codex not showing up in gigacode.

1 participant