Skip to content

fix(cli): name the resolved config file in the no-provider panel - #2010

Open
pcbeingused333 wants to merge 1 commit into
TokenRhythm:mainfrom
pcbeingused333:fix/agent-no-provider-config-path
Open

pcbeingused333 wants to merge 1 commit into
TokenRhythm:mainfrom
pcbeingused333:fix/agent-no-provider-config-path

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Scope

Scope boundary: the "No Provider Configured" panel printed by opensquilla agent names the config file the CLI actually reads instead of the literal ~/.opensquilla/config.toml.

Non-goals: no change to config resolution, provider detection, onboarding or the gateway.

Branch

Base branch: main

Target exception: N/A

Issue

Linked issue: Fixes #1990

Cause: _print_no_provider_error() in src/opensquilla/cli/agent_cmd.py hard-coded ~/.opensquilla/config.toml in the "Cause" paragraph and in "Option 3". The CLI reads a different file when OPENSQUILLA_STATE_DIR, OPENSQUILLA_GATEWAY_CONFIG_PATH or a profile home is in effect, so following the panel edited a file the command never loads and the same panel came back; the "has no [llm].api_key" sentence could also be false for the file it named.

Fix: the panel now prints the path returned by onboarding.config_store.resolve_config_path, the resolver that mirrors GatewayConfig.load, fed with OPENSQUILLA_GATEWAY_CONFIG_PATH exactly like run_agent_once does. Default setups keep printing ~/.opensquilla/config.toml.

Release Note

Release note: opensquilla agent without a provider now names the config file it actually reads (state dir, profile or explicit path) in the "No Provider Configured" panel.

Tests

Ruff: ruff check and ruff format --check clean on the two changed files.

Pytest: two new cases in tests/test_agent_cmd_no_key.py run agent -m hi with a temporary OPENSQUILLA_STATE_DIR and with OPENSQUILLA_GATEWAY_CONFIG_PATH and check the panel names that file and no longer the literal ~/.opensquilla/config.toml. Both fail on main and pass with the change; the file's four existing cases still pass (6 passed). Only this test file was run, not the full suite.

Build: not affected (CLI text only).

This change was prepared with the assistance of an AI coding agent (Claude).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant