Skip to content

fix: fall back to config file api_url when CLI flag/env var not set - #217

Merged
sachiniyer merged 2 commits into
mainfrom
siyer/fix-config-apiurl
Mar 24, 2026
Merged

fix: fall back to config file api_url when CLI flag/env var not set#217
sachiniyer merged 2 commits into
mainfrom
siyer/fix-config-apiurl

Conversation

@sachiniyer

@sachiniyersachiniyer commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cli::create_client() and the auth login handler only checked the --api-url CLI flag / DETAIL_API_URL env var, completely ignoring the api_url field in config.toml
  • Added effective_api_url() method that resolves with precedence: CLI flag/env var → config file → None (production default)
  • Both call sites (create_client and auth login) now use effective_api_url()

Test plan

  • Unit test: effective_api_url_uses_cli_flag — CLI flag is returned when set
  • Unit test: effective_api_url_none_without_cli_flagapi_url field is None when flag omitted, exercising the fallback path
  • Integration test: config_api_url_is_used_when_no_flag — valid token + bogus config api_url → command fails (proves config was read)
  • Integration test: cli_flag_overrides_config_api_url — bogus config api_url + real --api-url flag → command succeeds (proves flag wins)
  • All 185 existing unit tests pass
  • All 18 integration tests pass (16 existing + 2 new)

🤖 Generated with Claude Code


Open with Devin

Both `Cli::create_client()` and the auth login handler only checked the
`--api-url` CLI flag / `DETAIL_API_URL` env var, ignoring the `api_url`
field in config.toml. Added `effective_api_url()` that checks the CLI
arg first, then falls back to the config file value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@devin-ai-integrationdevin-ai-integrationBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sachiniyerGraphite App

sachiniyer commented Mar 24, 2026

Copy link
Copy Markdown
ContributorAuthor

@sachiniyer
sachiniyer merged commit 0545113 into mainMar 24, 2026
13 checks passed
@sachiniyer
sachiniyer deleted the siyer/fix-config-apiurl branch March 24, 2026 04:41
Sign up for freeto 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.

1 participant

@sachiniyer