Repository navigation
fix(config): treat a non-object agent section as malformed (#28885) - #29152
Conversation
A non-object agent section, such as an overlay's {"agent": null},
was removed by schema validation and read as unconfigured, so a
stored agent.kas_persist_mcp_sign_in false was dropped and KAS
started storing OAuth tokens against it. agent joins the fail-closed
validation paths, so the loader records the section as degraded and
every gate that reads a degraded agent section, the KAS sign-in vault
included, fails closed.
Closes #28867
(cherry picked from commit 5691cc8)
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is the exact pick of #28885 from main. It makes the Notes
[DESIGN-REVIEWED] dd33abb Description read[DESCRIPTION-READ] 46ed8dee3ff3f04cac05a4342af4df524549c674a95b761c11154e06b3fb45ef That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a clean fix pick. The doc line also adds What this change shipsInventory (4 items) — 3 justifiedIntent: keep the operator's stored
[FIRST-PRINCIPLES-REVIEWED] dd33abb Description read[DESCRIPTION-READ] 536e444551a5557fc981dac2bef04da20b09cac9e993e769fc13ca0c8abbc406 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
This looks good to me at dd33abb. Adding agent to _FAIL_CLOSED_PATHS keeps a non-object agent section (null, a list, a number) instead of repairing it to absent. _coerced_section then records agent as degraded and uses defaults for its settings, and kas_secret_storage.persistence_enabled already reads a degraded agent as off. So an overlay that replaces the base file's agent with null can no longer drop a stored false and turn on stored OAuth sign-ins. The parametrized test covers null and a list in config.local.json and a number in config.json, and the config spec lists the section.
One maintainer check remains before I can approve: the main CI (Fast Gate and the test, E2E and Integration jobs) has not run on this head; only the review lanes and policy checks have. Once it has run green, I will approve.
Problem / Motivation
Goal: Bring #28885 to
release/0.12.0so an insider build keeps a storedagent.kas_persist_mcp_sign_in: falsewhen an overlay sets a non-objectagentsection.On
release/0.12.0, a non-objectagentsection (for example an overlay's{"agent": null}) is dropped by schema validation and read as unconfigured. #29148 brought #28630, which turnsagent.kas_persist_mcp_sign_inon by default, so on 0.12 such a config makes KAS store OAuth tokens against the user'sfalse.Why it matters
#28630's default flip is already on
release/0.12.0(#29148). Without #28885, the next insider RC ships the default without the fail-closed guard that main has for it.Not a goal
release/0.11.0.What changed (motivation → approach → change)
git cherry-pick -xof main commit5691cc8eb8b94336d5715cdb16c58cfa7145bdb9(#28885) ontoorigin/release/0.12.0@0eee5c6082. It applied clean. Every added and removed line matches main's commit.The
agentsection joins the fail-closed validation paths inconfig/validation.py, so the loader records it as degraded and the KAS sign-in vault gate fails closed.config.mddocuments it;test_kas_mcp_secret_storage.pycovers it.Backwards compatibility
Compatible: a valid
agentobject loads as before; only a non-objectagentsection is now degraded instead of dropped.Removes nothing: no key, path or record is removed.
Tests
Proof: not provable -- other: a pick identical to main; its proof ran on #28885
test_kas_mcp_secret_storage.py,test_config_loader_sections.py,test_config_load_pipeline_field_defaults.py: 330 passed.config/validation.py,docs-lint,check_harness_parity,check_comment_history,check_brand_name,check_file_line_cap,check_subprocess_encoding: all pass.Manual verification
N/A - unit coverage from #28885 applies unchanged.
Related Issues
Part of #28867. Follows #29148.
Sibling sweep
Siblings: none -- an exact pick of #28885; its own sweep ran on main.
Pattern harvest
Not generalizable: a release-branch pick of a fix already harvested on #28885.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.