Skip to content

fix(acp): accept qualified model ids - #17892

Merged
chenmingwei23 merged 1 commit into
mainfrom
r21-push-9054-model-regex
Oct 8, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
r21-push-9054-model-regex

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Replaces #9054 by @Premshay. Fixes #17891.

I have ADMIN/push on the repo, so this is an in-repo replacement of the fork PR to run the full CI + review lanes. The change is identical to the author's.

Problem / Motivation

Goal: Cron and subagent model selections can use the provider-qualified ids (such as gpt-6-astra[high]) that the model picker itself offers.

Provider-qualified effort variants such as gpt-6-astra[high] are rejected when a dashboard cron or a subagent spawn records a model selection, despite being safe model identifiers advertised by kiro-cli's own model list.

Why it matters

Cron and spawn model selections whose ids carry a provider qualifier cannot be saved or applied.

Not a goal

  • Widening MODEL_ID_RE or the AcpRuntime model validation.
  • Accepting arbitrary bracket content: exactly one non-empty trailing qualifier.
  • The hidden-models config gate, which still rejects bracketed ids (follow-up).

What changed (motivation → approach → change)

The shared spawn and cron _MODEL_NAME_RE accepts one optional, nonempty trailing bracket qualifier. Unbalanced, nested, repeated, empty and non-trailing qualifiers remain rejected, as do shell metacharacters. MODEL_ID_RE and ACP runtime validation are unchanged.

The unrelated frontend restyle-baseline edit is removed. The touched model-selection test is Black-clean, so the required formatting ratchet removes its baseline exemption.

Backwards compatibility

Compatible: existing unqualified ids match the new pattern unchanged; the pattern only adds the bracket-qualifier class.

Pattern harvest

Rule candidate: when a provider protocol qualifies a value with a bounded suffix, extend a constrained allowlist rather than bypassing validation.

Tests

Verified locally on the repaired branch:

  • 43 focused model-selection and cron tests passed.
  • Frontend scoped gate: 10,562 tests passed across 348 test files.
  • Black ratchet, isort, flake8 and subprocess-encoding checks passed.
  • Changed validator passes mypy.

Broader backend run previously reported 49,499 passes, 135 failures and 112 skips. All 135 failed identifiers were rerun against clean upstream base 6819b80069d1bf56c4263be5c453d54cad82de34: 134 failed there too; the remaining session-control case passed on both that base and this repair branch. The full backend suite is not claimed green.

Full mypy checked 1,995 source files and reported one Python 3.14 compatibility error at src/kiro_crew/cli.py:448 (asyncio.PidfdChildWatcher). A focused mypy run against the same CLI file on the clean base reproduces that error.

Current-head Windows evidence: shard 1 failed test_a_third_turn_routes_from_the_base_model_again: the third decision-log row was missing after an exclusive file-lock timeout (0.5 seconds). The exact test passes on Linux at this head and clean base d8fa6a527e927504b399246332cd243d7b450e2f; its test and decision-log implementation are byte-identical there. This does not establish a Windows baseline failure or a flaky result. Native Windows reproduction is still needed to identify the lock holder.

The failed PR Hygiene job read an older description missing **Goal:** and ## Not a goal. The current body contains both and passes the repository's description checker.

Manual verification

N/A — focused automated coverage is sufficient.

Related Issues

N/A.

Checklist

  • Existing tests pass and regression coverage is included (Windows failure remains under investigation).
  • Self-review completed; code follows project style guidelines.
  • Documentation updated where applicable.
  • No secrets, credentials, or internal references in the diff.

Contribution License Agreement

N/A — template placeholder; no CLA wording is supplied.

@iamwhatever
iamwhatever requested a review from a team as a code owner October 7, 2026 21:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0cb5b0374a8bdb2c112b2c48b1cdfdb2330d959c — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check before merge: the shared _MODEL_NAME_RE also accepts bracketed ids on session_create, session_set_model and kirocrew cron add. The description scopes the change to cron and spawn only.

Not justified as shipped

  • Item 3 — undeclared: the Goal names only "Cron and subagent model selections", but the same regex also guards SESSION_CREATE_SCHEMA (validation.py:3748), the schema at validation.py:4000, session_set_model (dashboard/session_control.py:2561) and CLI cron add (cli_commands.py:1854).

What this change ships

Inventory (5 items) — 4 justified

Intent: let a cron job or subagent spawn save a provider-qualified model id that the model picker itself offers (#17891). FIX.

  1. Dashboard cron create and the spawn tools accept model[qualifier] ids such as gpt-6-astra[high] and …[1m] — justified
  2. Empty, nested, repeated, non-trailing and metacharacter qualifiers are still rejected — justified
  3. Session create, session set-model and CLI cron add now also accept bracketed ids, because they share the regex — undeclared
  4. test/test_model_selection.py removed from the Black baseline — justified
  5. New "Model-name format" section in the model-selection spec — justified

[FIRST-PRINCIPLES-REVIEWED] 0cb5b03

Description read

[DESCRIPTION-READ] c06eee4eadf253c79fd9b2c7adca4cdd073426afddf0d544762675a8f029c848

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 Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 0cb5b0374a8bdb2c112b2c48b1cdfdb2330d959c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that session create (session_control.py:2561) and the CLI (cli_commands.py:1854) should also accept bracketed ids; they share _MODEL_NAME_RE, but the description names only cron and spawn.

[DESIGN-REVIEWED] 0cb5b03

Description read

[DESCRIPTION-READ] 552042d1650eea05d1465b2ffe5e61566fbf2fc531153db9131718ca5b54fd72

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 Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 0cb5b03

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0cb5b0374a8bdb2c112b2c48b1cdfdb2330d959c: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0cb5b03

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0cb5b0374a8bdb2c112b2c48b1cdfdb2330d959c: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 7, 2026
Widen the shared cron/subagent _MODEL_NAME_RE to accept exactly one
optional non-empty trailing bracket qualifier (e.g. gpt-6-astra[high]).
Empty, unbalanced, nested, repeated or non-trailing qualifiers and shell
metacharacters remain rejected. MODEL_ID_RE and ACP runtime validation
are unchanged. The touched test file is Black-clean, so its baseline
exemption is removed.

Fixes #17891
Replaces #9054 by @Premshay

Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com>
@iamwhatever
iamwhatever force-pushed the r21-push-9054-model-regex branch from 8f6e3b5 to 0cb5b03 Compare October 8, 2026 00:13
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 0cb5b0374a8bdb2c112b2c48b1cdfdb2330d959c touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 8, 2026
@iamwhatever iamwhatever mentioned this pull request Oct 8, 2026
3 of 4 tasks
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 8, 2026 04:23

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: fix with a diff that matches its description. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/common/model-selection.md.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Self-review (crew-pr-reviewer, read-only): RECOMMEND APPROVE

Reviewed head 0cb5b03. Cron and subagent validation now accepts the provider-qualified ids the picker itself offers (for example gpt-6-astra[high]), so a pick from the UI no longer fails validation. Both lanes PASS.

@chenmingwei23
chenmingwei23 merged commit 30d3e1a into main Oct 8, 2026
103 checks passed
@chenmingwei23
chenmingwei23 deleted the r21-push-9054-model-regex branch October 8, 2026 05:59
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model-name validator rejects provider-qualified ids (e.g. gpt-6-astra[high])

4 participants