Repository navigation
fix(ci): clear the pylint/black regressions blocking every PR's merge - #4370
Conversation
The Agent UI backend would not import at all: `ChatAgentConfig(...)` in the autonomous tick path was passed `device=` twice, which is a SyntaxError, so `gaia.ui.server` and everything importing it died at module load. That took out the Linux/Windows/macOS unit-test jobs on main. Nobody wrote the duplicate. #3666 added `device=session.get("device")` and #4275 independently added the same kwarg a few lines up, next to `min_context_size`. Neither diff conflicted textually, so the merge queue merged both cleanly and produced a file that does not parse. The two lines were identical, so removing the later one restores exactly the intended call.
Two loose ends from #3402, both of which turned a CI gate red. The pylint "critical errors" gate failed on a reimport: `_cancel_requested` re-imported `tool_cancelled` from `gaia.agents.base.tools` while the module already imports it at the top from `gaia.tool_cancellation`. The former is a pure re-export of the latter, so the local import bound the identical function object and only shadowed the existing name. Dropping it is a no-op. The new `wait_for_condition` tool shipped with no entry in the flagship's UI tool-label map, which `test_every_registered_tool_has_a_label` guards — an unlabeled tool falls back to a humanized name nobody chose.
#4271 landed an assertion that exceeds the line limit, so the black gate went red for every PR behind it. Pure line-wrapping; the assertion is unchanged.
Verdict: Approve
One correction to the PR description, worth knowing before someone files the follow-up: the claim that the wait tool "skips the confirmation gating its sibling gets" isn't right. That tool is already covered by the same shell-command permission gate as its sibling; the set it's missing from only drives a cosmetic "local change" status line in the chat stream. The inconsistency is real and still worth tidying, but it's a display detail, not a permission hole — so the follow-up shouldn't be filed as a security gap. Real-world evidence
$ git show 0931395f^:src/gaia/ui/agent_loop.py > /tmp/agent_loop_parent.py
$ python -m py_compile /tmp/agent_loop_parent.py
File "…/agent_loop_parent.py", line 465
device=session.get("device"),
SyntaxError: keyword argument repeated: device
$ python -m py_compile src/gaia/ui/agent_loop.py
HEAD agent_loop.py compiles OKThe backend then booted and served for real ( {"type": "tool_start", "tool": "wait_for_condition", "detail": "Waiting for a condition"}
label without (fallback): wait for condition <- what the UI showed before this PRCancellation was checked in-process rather than through a user-facing surface ( 🔍 Technical detailsVerified, no findings:
🟢 Follow-up note is mis-scoped (not a change request on this PR) — 🟢 Strengths
|
mainhas been red since 2026-09-25 18:29, so nothing can leave the merge queue. Three separate regressions landed within minutes of each other; this clears all three. The worst is a literalSyntaxError—ChatAgentConfig(...)was passeddevice=twice, so the Agent UI backend and everything importing it failed at module load, taking out the Linux, Windows and macOS unit-test jobs. Nobody wrote that duplicate: #3666 and #4275 each added the same kwarg a few lines apart, neither diff conflicted textually, and the merge queue merged both cleanly into a file that does not parse.The other two are one-liners: #3402 re-imported
tool_cancelledover a name the module already imports (failing the pylint gate) and shippedwait_for_conditionwith no UI label, and #4271 landed an over-long assertion (failing the black gate).Worth knowing: the ~13 "new pylint errors" that appear in the failing job's log are not pylint errors. They are the first 20 lines of the non-blocking MyPy output (1224 warnings, truncated for display) and have never gated anything. Only one pylint hit was real. No dependency or tool-version drift was involved — pylint 4.0.9 and black 26.5.1 both predate the last green run.
Test plan
python util/lint.py --black— clean (1180 files unchanged)uvx pylint src/gaia --rcfile .pylintrc --disable C0103,C0301,W0246,W0221,E1102,R0401,E0401,W0718,W0212— clean on Linuxpython -m compileall -q src/gaia tests— no syntax errorspython -m pytest tests/unit/test_schedule_daemon.py -q— 28 passedpython -m pytest tests/unit/chat/ui -q— 1040 passed (was 17 collection errors)🔍 Technical details
src/gaia/ui/agent_loop.py— the twodevice=session.get("device")lines were textually identical, so deleting the later one restores exactly the intended call.git blameattributes line 461 to1caad2ade5(#4275) and line 465 to7a8fea58b1(#3666); #3666 is an ancestor of the last green commit69f76ab57, so #4275 is the one that created the duplicate.src/gaia/agents/tools/shell_tools.py—gaia.agents.base.tools.tool_cancelledis a pure re-export ofgaia.tool_cancellation.tool_cancelled, which the module already imports at line 31. Verified the bindings are the same object, so dropping the function-local import is a no-op rather than a behaviour change.Follow-up worth a maintainer's eye, deliberately not bundled here:
wait_for_conditionexecutes arbitrary commands against the same allowlist asrun_shell_command, but unlikerun_shell_commandit is not in_GAIA_MUTATING_TOOLS. By that set's own stated criterion ("or execute code") it looks like it belongs there, and omitting it means the tool skips the confirmation gating its sibling gets. That is a behaviour change, not a CI fix, so it should be reviewed on its own rather than smuggled into an unblock PR.Also noted:
.pylintrcusesdisable = allplus an explicitenablelist that does not includesyntax-error, which is why the pylint gate walked past a file it could not parse. EnablingE0001would have caught this at PR time.