Repository navigation
Description
A typo in a section name already gets a clear message (Unknown section(s) in gulliver.toml: budjet, see #77). A section that has the right name but the wrong shape does not. Writing a plain value where a table belongs ends in a Python traceback on every command:
printf 'budget = 3\n' > t.toml
gulliver --config t.toml status
# Traceback (most recent call last):
# ...
# File "src/gulliver/config.py", line 275, in load_settings
# budget_data = dict(data.get("budget") or {})
# TypeError: 'int' object is not iterable
printf 'connections = "x"\n' > t.toml
gulliver --config t.toml status
# AttributeError: 'str' object has no attribute 'items'
printf '[connections]\nx = 1\n' > t.toml
gulliver --config t.toml status
# TypeError: 'int' object is not iterable (config.py line 254, dict(conn_data))
printf 'lint = 5\n' > t.toml
gulliver --config t.toml lint "SELECT 1"
# TypeError: 'int' object is not iterable (lint_files.py line 150)
printf 'review = 3\n' > t.toml
gulliver --config t.toml review --models models
# TypeError: 'int' object is not iterable (review.py line 106, load_policy)
printf 'approval = "cli"\n' > t.toml
gulliver --config t.toml status
# "error": "Unknown approval keys: c, i, l" (a string is read as a table of characters)All other config mistakes in gulliver.toml (unknown keys, a bad fail_on, a bad [approval] channel) are reported as status: "error" with next_step: "Fix gulliver.toml or the flags." and exit code 1. These should be too: someone who writes budget = 3 meant a limit, and a traceback does not tell them where to look.
Checked on current main (c48adf8).
What should happen
Each of these returns status: "error" (exit code 1) with a message that names the section and the type that is expected, for example [budget] must be a table (a [budget] section with keys), not 3 and next_step: "Fix gulliver.toml or the flags.". Valid files behave exactly as before.
Where to start
src/gulliver/config.py:load_settings(...)(around line 239).data.get("connections"),data.get("budget")anddata.get("approval")are used without a type check (lines 253, 254, 275, 285);ConfigErroris the error type the CLI already turns into a clean message. A tiny helper such as_table(data, "budget")that raisesConfigErrorwhen the value is not a dict would cover all of them, and[connections.NAME]entries need the same checksrc/gulliver/lint_files.py(load_lint_config, around line 150) andsrc/gulliver/review.py(load_policy, around line 106) read[lint]and[review]the same way- Tests:
tests/test_config.py(test_unknown_top_level_section_is_refusedandtest_every_known_section_loadsshow how to write agulliver.tomlintmp_pathand callload_settings)
How to test
printf 'budget = 3\n' > t.toml && gulliver --config t.toml status # now: an error, exit code 1, no traceback
printf 'lint = 5\n' > t.toml && gulliver --config t.toml lint "SELECT 1"
pytest tests/test_config.pyDone when
-
budget,connections, a[connections.NAME]entry,approval,lintandreviewwith a value that is not a table give aConfigError-style message naming the section (exit code 1, no traceback) - A valid
gulliver.toml(every example ingulliver.example.toml) loads exactly as before - A parametrized test with one wrong-type file per section
- Leave CHANGELOG.md alone; the maintainer adds the entry with credit to you when it is merged
-
pytestandruff check .pass
Comment here to claim it and you'll be assigned.
Activity
amritkang165 commentedon Nov 11, 2026
I’d like to take this one. I’ll add type checks for the affected config sections, keep valid configs working as before, and test that invalid values produce clear errors without tracebacks.
laaielichter commentedon Nov 11, 2026
Thanks @amritkang165, you asked for #126 at 13:32 on 2026-11-11 and that is the first claim on this thread, so it is assigned to you. Your plan matches the issue, and I see PR #144 is already open for it, so I will review it next. Thank you for taking on a third issue in a row after #129 and #128.
Generated by Claude Code
Merge pull request #144 from amritkang165/fix/config-section-types
docs(changelog): credit #126, #128, #139, #144
Merge pull request #185 from laaielichter/claude/friendly-rubin-aj23ha