Skip to content

add: solvent config — view and edit local configuration#44

Merged
ianalloway merged 1 commit into
mainfrom
claude/solvent-config
Jun 30, 2026
Merged

add: solvent config — view and edit local configuration#44
ianalloway merged 1 commit into
mainfrom
claude/solvent-config

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Summary

  • solvent config — show all config values in aligned columns
  • solvent config get <key> — print a single value (scriptable)
  • solvent config set <key> <value> — update and persist with full validation
  • solvent config reset — restore all defaults
  • --json flag on show/get for piping to jq

Type coercion handles bool (true/false/yes/no/1/0), int, float, and str. Every set runs SolventConfig.validate() before writing, so invalid values are rejected with a clear error.

Wraps the existing solvent/config.py dataclass — no schema changes.

Test plan

  • python3 -m pytest tests/test_config_cmd.py -v → 22 passed
  • python3 -m pytest -q → 436 passed, 6 skipped
  • solvent config → aligned table of all keys
  • solvent config set model nemotron → persists to .solvent/config.json
  • solvent config set model bad-value → exits 1 with validation error
  • solvent config get model --json"nemotron"
  • solvent config reset → resets to offline

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6


Generated by Claude Code

- solvent config              show all values (aligned columns)
- solvent config get <key>    print a single value
- solvent config set <key> v  update and persist; validates on write
- solvent config reset        restore all defaults
- --json flag on show/get for scripting
- Type coercion: bool (true/false/yes/no/1/0), int, float, str
- Full validation via SolventConfig.validate() before every save

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6
@ianalloway ianalloway marked this pull request as ready for review June 30, 2026 16:54
Copilot AI review requested due to automatic review settings June 30, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ianalloway ianalloway merged commit fdbb130 into main Jun 30, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8edb0c11ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread solvent/config_cmd.py
Comment on lines +121 to +122
p.add_argument("--json", dest="as_json", action="store_true",
help="output as JSON")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept --json after get and show

When callers use the documented/scriptable form solvent config get model --json, argparse treats --json as an argument to the get subparser; because it is only registered on the parent parser here, the command exits with unrecognized arguments: --json. Scripts following the advertised get <key> --json usage have to know to put --json before the subcommand instead, so please add the option to the show/get subparsers or otherwise parse both positions.

Useful? React with 👍 / 👎.

Comment thread solvent/config_cmd.py
return int(value)
if field_type == "float":
return float(value)
return value # str and anything else

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle list-valued config fields before saving

When users set telegram_allow_from, _field_type_name returns list[str] | None, so this fallback persists the raw CLI string even though the config field is a list. Later apply_config treats it as a list and does ','.join(config.telegram_allow_from), which turns an ID like 123456789 into 1,2,3,4,5,6,7,8,9, so allowlist mode will not recognize the intended user. Please parse this field into a list or reject unsupported non-scalar types instead of saving a string.

Useful? React with 👍 / 👎.

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.

3 participants