Skip to content

fix: read dashboard.max_background_turns and xdist_auto_cap from the config.local.json overlay - #47903

Open
javenciu wants to merge 1 commit into
mainfrom
fix/honor-config-local-overlay-two-readers
Open

javenciu wants to merge 1 commit into
mainfrom
fix/honor-config-local-overlay-two-readers

Conversation

@javenciu

@javenciu javenciu commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A dashboard.max_background_turns or resource_limits.xdist_auto_cap value set in config.local.json takes effect, as Settings and config get already show.

Both readers parse config.json only through _raw_config(). With the value only in the overlay, the unattended-turn cap stays at the default 3 and the xdist worker cap stays at -1 (not capped), while the loader and Settings report the overlay value.

Why it matters

An operator who pins a limit in the user-owned overlay sees it in Settings, but it is silently dropped: the background-turn cap, the background_turns status field and the queueing message ignore it, and pytest-xdist -n auto in agent children is not capped.

Not a goal

  • The sandbox-enforcement readers of resource_limits (sandbox_cgroup.py, sandbox_slice.py, sandbox_rlimit.py): letting the unsealed overlay change them is a sandbox policy change.
  • dashboard.export_include_layer_b: a data-egress opt-in.

What changed (motivation → approach → change)

#47838 fixed two _raw_config() readers by merging config.local.json over it with _deep_merge. These two readers have the same shape. Both now use that same merge (_deep_merge(_raw_config(), read_merged_config_files(config_local_path()))), so the overlay wins key by key. The [1, MAX_BACKGROUND_TURNS_CEIL] clamp and the junk-value fallbacks are unchanged. The config spec lists the two readers beside the MCP ones.

  • src/kiro_crew/dashboard/state_parts/dashboard_services.py: effective_max_background_turns
  • src/kiro_crew/resource_status.py: _xdist_cap_config

Backwards compatibility

Compatible: config.json-only behavior is unchanged; the change only adds the overlay read that was missing.

Removes nothing: no key, function or path is removed or renamed.

Tests

test/test_config_overlay_raw_readers.py: each value set in the overlay only, in both files (overlay wins), in config.json only, and in neither (default).

Proof: PROVEN test_the_background_turn_cap_reads_the_overlay[overlay-only], test_the_background_turn_cap_reads_the_overlay[overlay-wins], test_the_xdist_auto_cap_reads_the_overlay[overlay-only], test_the_xdist_auto_cap_reads_the_overlay[overlay-wins] (head f02adfa)

Manual verification

N/A — unit coverage sufficient: the readers are pure file reads covered by the parametrized cases.

Real-machine verification

N/A -- the diff reads two config files; no process, service or platform behavior changes.

Related Issues

Sibling of #47838, which fixed the MCP read limit and spill threshold readers.

Sibling sweep

Swept: git grep -n "_raw_config()" -- src/
Sibling: src/kiro_crew/dashboard/state_parts/dashboard_services.py -- changed here
Sibling: src/kiro_crew/resource_status.py -- changed here
Sibling: src/kiro_crew/sandbox_cgroup.py -- not affected -- sandbox policy surface, deliberately unchanged
Sibling: src/kiro_crew/sandbox_slice.py -- not affected -- sandbox policy surface, deliberately unchanged
Sibling: src/kiro_crew/sandbox_rlimit.py -- not affected -- sandbox policy surface, deliberately unchanged
Sibling: src/kiro_crew/dashboard/session_export.py -- not affected -- data-egress opt-in, deliberately unchanged

Pattern harvest

Rule candidate: review-prompt
Pattern: a raw _raw_config() read of a key the loader also takes from config.local.json.

Checklist

  • A Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners December 5, 2026 20:48
@javenciu
javenciu requested a review from bolichen97 December 5, 2026 20:48
@javenciu
javenciu enabled auto-merge (squash) December 5, 2026 20:48
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision f02adfae6b136d0efcf99e1fe630cf4778af2778 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f02adfae6b136d0efcf99e1fe630cf4778af2778 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. This is a small overlay merge on two non-sandbox readers that matches #47838. It leaves the sandbox and egress readers alone on purpose, and it removes nothing.

Notes

  • The same line, _deep_merge(_raw_config(), read_merged_config_files(config_local_path())), now appears in four places: resource_status.py, dashboard_services.py, mcp_gateway/pool.py and mcp_gateway/read_limits.py. Moving it into one loader helper, such as _raw_config_with_overlay(), would mean the next overlay reader is a one-word change. It would also keep the sandbox readers' deliberate refusal visible as a choice not to call that helper, so nobody mistakes it for a missed copy.

[DESIGN-REVIEWED] f02adfa

Description read

[DESCRIPTION-READ] 23a1667692eb382cd2346c505285c93aaff1de93ac2d8e7263dcda85e21b8308

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f02adfae6b136d0efcf99e1fe630cf4778af2778 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f02adfa

Verdict parsed from the review's SHA-scoped output markers for commit f02adfae6b136d0efcf99e1fe630cf4778af2778.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f02adfae6b136d0efcf99e1fe630cf4778af2778 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f02adfae6b136d0efcf99e1fe630cf4778af2778 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

This fixes a reported defect at the mechanism level and adds no new surface. The only open point is that the same merge line is now written out four times.

Notes

  • Item 1, 2 — symptom-level: the line merged = _deep_merge(_raw_config(), read_merged_config_files(config_local_path())) now appears 4 times. Grepping _deep_merge\(_raw_config\(\) finds it in mcp_gateway/pool.py:201, mcp_gateway/read_limits.py:77, resource_status.py:1483 and dashboard_services.py:313. Two more readers stay on config.json alone: work_ledger_rules.py:276 (its warning text, and it is missing from the sweep) and the sandbox readers, which are a stated non-goal. Subtraction: replace the four copies with one loader-owned call.

What this change ships

Inventory (3 items) — 3 justified

Intent: make a background-turn cap or xdist worker cap set in config.local.json actually take effect, matching what Settings already shows. FIX.

  1. A dashboard.max_background_turns value set in config.local.json now changes the unattended-turn cap. — justified
  2. A resource_limits.xdist_auto_cap value set in config.local.json now caps -n auto in agent children. — justified
  3. The config spec lists the two readers that merge the overlay. — justified

[FIRST-PRINCIPLES-REVIEWED] f02adfa

Description read

[DESCRIPTION-READ] 46608b016c523c748743fe8bde1f62825e370afb5f1d2b748a5c93daa43ab4ab

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f02adfae6b136d0efcf99e1fe630cf4778af2778 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f02adfa

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f02adfae6b136d0efcf99e1fe630cf4778af2778 false-positive: <reason, 20 to 500 characters>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant