Conversation
|
Closing this PR. The reason is the state of the repository, not the change. Measured against
About the red ✗ that will appear on this PR within seconds of the close: on the two earlier batches in this repo today (five PRs closed at 18:22Z, five at 22:32Z), closing moved each head's two parked runs from Why this is a close and not a withdrawal — and why there are now eleven of these. This PR was opened at 22:16:08Z, four hours after #464-#472 were closed and during the same evening as #476/#478/#480/#482/#484. Ten of mine had already been closed on this repository today on these same three measurements (five at 18:22Z, five at 22:32Z); this one makes eleven, and #488 (23:15:00Z) follows. The changes are not the problem; the repository has no path from "PR opened" to "PR merged" for anyone right now, and leaving unreviewable PRs open hides that from everyone, including the people who might revive the project. The branch |
|
Reopening at the lane owner's instruction, 2026-09-26. Re-checked against My closing comment recorded why the thread was parked - this repository has accepted no pull requests since 2026-02-05, so fork CI runs here stay at |
Description
Config.create()looks the lakeview model up with a bare dict index, so alakeview.modelname that is not defined undermodels:aborts config loading withKeyError: '<name>'instead of theConfigErrorthis function raises for every other bad model reference.The same block two lines above already promises a
ConfigError:and the sibling lookup in the very same function wraps the identical failure:
This makes the fix the same two lines, with the same message, so the only unwrapped model lookup in
Config.create()now behaves like the other two. Measured onmain(e839e55), changing only which section carries the typo:mainagents.trae_agent.modelConfigError: Model X not foundConfigError: Model X not found(unchanged)lakeview.modelKeyError: 'X'ConfigError: Model X not foundtrae-cli run,trae-cli interactiveandtrae-cli show-configall callConfig.create(...)with notry/except(trae_agent/cli.py:294,:459,:650), so the bareKeyErrortraceback is what a user gets - and it does not mentionlakeview,models, or the config file.More Information
Resolves #485.
The regression tests go into a new file,
tests/utils/test_config_model_lookup.py, rather than intotests/utils/test_config.py: that file already carries theTestLakeviewConfigandTestConfigBaseURLcases and is being edited by five other open PRs (four of them at its import block), so a new focused file keeps this diff free of incidental conflicts. Two of the three tests are green onmainon purpose - they pin the happy path (lakeview.modelthat exists still loads) and the neighbouringConfigError("No model provided for lakeview")branch, so neither can be broken by this change.Nothing here changes behaviour for a valid config: the wrapped lookup returns the same object, and
raise ... from ekeeps the originalKeyErrorin the chain for anyone debugging.This is not a regression.
git log --all -S'lakeview_model = config_models'returns only6fc646d New Configuration System backed by YAML (#234)andc924aab refactor(config): move legacy config conversion to Config class, so the lookup has been unwrapped since the YAML config system landed.Two things this deliberately does not touch, so the diff stays about one defect:
models.<name>entries that omitmodel_providerstill raiseKeyError: 'model_provider'fromconfig.py:246(model_config["model_provider"]). Same family, different line; it needs its own report.trae_agent/tools/base.py:229-236renders tool exceptions asf"...: {str(e)}", which drops the exception type. Worth knowing because it is how this error reaches an agent mid-run, but changing it would affect every tool.Because a
.github/workflows/*rule limits the repo's workflows to the upstream repository, CI on a fork PR stops ataction_requiredand never runs; everything below was executed locally on Windows.Validation
All commands run against
main(e839e559ac61bdd0e057c375dd1dee391fee797d).1. Red - the new tests on unmodified source. Worktree at
e839e55containing only the new test file, interpreter from the project venv withPYTHONPATHpointed at the worktree (import trae_agentself-checked asUSING D:\Desktop\pr\trae-wt-lakeview-2143\trae_agent):2. Green - after the change.
3. End-to-end, no mocks - the same config file read by the same command on both trees.
lakeview-demo.yamldeclaresenable_lakeview: trueand alakeview.modelthat is not inmodels::Full traceback on
main:4. Full suite, branch vs. a clean-
maincontrol run in this same session. Control is a separate worktree checked out ate839e55(not the shared clone), so the comparison is apples to apples:The three failures are the identical Windows-only
tests/tools/test_bash_tool.pycases on both trees (diffof the twoFAILEDlists is empty):They are a pre-existing
mainbaseline on Windows (pexpect/bash), unrelated to this change, and they do not fail on the Ubuntu CI runner.5. Lint and type checks -
pre-commit run --files trae_agent/utils/config.py tests/utils/test_config_model_lookup.py:The single mypy error is in
trae_agent/tools/bash_tool.py, which this PR does not touch:os.setsidis POSIX-only and does not exist on Windows, so this line errors on every local mypy run on this platform (checked 2 source files- neither of the two files in this diff produced an error). It will not appear on the Ubuntu CI runner.6. Conflict check against the open PRs that also edit
config.py.trae_agent/utils/config.pyis touched by #434/#435/#436/#437, #412 and #409, so each was fetched and test-merged against this branch:Exit code
0means a clean merge. Their hunks increate()start at line 269 (allow_mcp_servers); this diff ends at 262.Linked Issues
Resolves #485