Repository navigation
fix(cli): report an invalid config.toml as one readable error instead of a traceback - #2002
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
… of a traceback Fixes TokenRhythm#1988 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
A semantically invalid value in
config.toml(for example a Slack socket channel withoutapp_token) madechannels list|enable|remove,agents list,skills listandgateway statusprint a 47–64 line pydantic traceback, whiledoctorandonboard statusalready reported the same problem as one line plus a recovery command.The one-line error already existed in
onboard_cmd.py. This moves its formatter and exit helper tocli/config_errors.py(same message, exit code 2) and uses it where the traceback came out: thechannelscommands,agents,skillsoffline loading, the config read behind the Gateway URL (which is whatskills listcrashed in), and theValidationErrorbranch ofgateway statusthat re-raised everything but the port error.Scope boundary: CLI error output for the sites reproduced in #1988. Behavior and messages of
onboardare unchanged.Non-goals: converting
ValidationErrorinto a domain error inside the config loaders, the consistency test that counts unguarded load sites, and the other unguarded sites that were not reproduced.Branch
Base branch: main
Target exception: N/A
Issue
Linked issue: Fixes #1988
Release Note
Release note: An invalid value in config.toml is now reported as one readable error with a recovery command, instead of a Python traceback, by
channels,agents,skills listandgateway status.Tests
Ruff:
ruff checkpasses onsrc/opensquilla/cliand the new test.Pytest:
tests/test_cli/test_config_load_errors.py: 9 passed;tests/test_cli: 1037 passed, 2 failed intest_diagnostics_smoke.pybecausetiktokenwas not installed in the test environment.Build: not run. No frontend changes.
Regression tests: added
Notes:
app_tokenconfig from the issue and asserts exit code 2, the readable message and the onboarding hint, and no traceback. All 7 fail onmainand pass with the change.test_invalid_implicit_config_is_reported_oncecovers a broken config found without--configor an environment variable (skills list,gateway status) and asserts the error block is printed exactly once:default_gateway_targetswallows load failures on the implicit path and falls back to the default URL, so the exit has to happen only where the user named the config path, orskills listwould print the block twice.Maintainer Live Check
Maintainer live check: no
Surface: N/A
Safety
No secrets, local-only artifacts, private prompts or transcripts, channel identifiers or non-public fixtures are committed; the test fixture is the config from the issue with a placeholder token.
Third-Party Origin
Third-party origin: none
Documentation Changes
This change was prepared with Claude Code (AI-assisted); the tests above were run.
🤖 Generated with Claude Code