Skip to content

feat(cli): pin kirocrew spawn run to a model with --model - #23374

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
famanson:feat/spawn-run-model
Oct 24, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
famanson:feat/spawn-run-model

Conversation

@famanson

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: kirocrew spawn run can pin the spawned run to a model.

spawn run takes --agent and --crew (#20980) but no model, so a CLI spawn always runs on auto, and is routed when Jev is armed. The native spawn_run tool and session_create (#14049) already take one.

Why it matters

A script or crewmate on the CLI cannot ask for a model except through a template or member pin.

Not a goal

  • Checking the id against the backend's advertised models. --model gets the same shape check as the spawn_run tool.

What changed (motivation → approach → change)

--model ID posts the request's model field through the existing agent/crew loop, so the gateway admits it as it does for the tool. An explicit model outranks the member's and template's pins and is never routed.

The blank check moves from strip() to sanitize_string, the gateway's own sanitizer: a value of only whitespace or hidden characters ($'\u200b') used to pass the CLI, sanitize to empty at the gateway and run the default.

Backwards compatibility

Breaking: none. --agent/--crew that sanitize to empty are now refused instead of running the default; the message says "needs a value".

Tests

test_cli_spawn_run_agent_crew.py: model forwarding, the blank refusal for all three flags, and raw posting.

Manual verification

N/A: a CLI flag onto an existing request field; unit coverage.

Related Issues

Closes #23373

Pattern harvest

Not generalizable: one more flag on an existing request field.

Checklist

  • At most two commits (one is the norm), with 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

Contributed under Apache-2.0.

@famanson
famanson requested review from a team and KiroCrewCaptain as code owners October 23, 2026 08:04
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 8726c80c16d2420a102a1cf74032e35b9848e5d5 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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 8726c80c16d2420a102a1cf74032e35b9848e5d5 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the new flag sends an existing /api/spawn field that the gateway already checks for the spawn_run tool, and the stricter blank check follows the gateway's own sanitizer.

[DESIGN-REVIEWED] 8726c80

Description read

[DESCRIPTION-READ] ffdfbaa0e9775c16096e28cd35f232bcf87e3dc832b4c56eccf2def0c9245de8

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 8726c80c16d2420a102a1cf74032e35b9848e5d5 via the fork AI-review pipeline — 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

Nothing blocks: the flag passes a value into the model request field that /api/spawn already reads, and moving the blank check to sanitize_string closes a gap where a hidden-character-only value silently ran the default.

Notes

  • Item 2 — rides along: "The blank check moves from strip() to sanitize_string" also changes how --agent/--crew are handled. The description says so under Backwards compatibility, and it reuses the gateway's own sanitizer, so it carries no premise risk.

What this change ships

Inventory (4 items) — 3 justified

Intent: let a CLI script or crewmate pin a spawned run to a chosen model, as the spawn_run tool already can. ADDITION.

  1. kirocrew spawn run --model ID sends the run's model to the gateway, which checks its shape and lets it outrank the member and template pins — justified
  2. --agent/--crew values made only of whitespace or hidden characters are now refused at the CLI — rides along
  3. The blank-value error now reads "needs a value" instead of "needs a name" — justified
  4. The spec, the commands skill and the help examples document --model — justified

[FIRST-PRINCIPLES-REVIEWED] 8726c80

Description read

[DESCRIPTION-READ] 9d34140a7e9fc4872b116973b8c51d272ca78035201cbdf9352c7bf16140b107

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 8726c80c16d2420a102a1cf74032e35b9848e5d5 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8726c80

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 8726c80c16d2420a102a1cf74032e35b9848e5d5 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8726c80

@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 23, 2026
@famanson
famanson force-pushed the feat/spawn-run-model branch from 8482673 to 8726c80 Compare October 23, 2026 10:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve at 8726c80.

--model is sent as the request field that /api/spawn already validates for the spawn_run tool. The CLI and the tool therefore share one admission path, and the owner check is unchanged. The blank check now uses the gateway's own sanitize_string. A value made only of whitespace or hidden characters is refused instead of silently running the default, and the description declares that change. Tests cover forwarding, the blank refusal for all three flags and a malformed model refused at the gateway. Every AI lane passes and CI is green on this head.

— crew-pr-reviewer (r123)

@iamwhatever
iamwhatever merged commit fb3f4ae into kirodotdev:main Oct 24, 2026
103 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kirocrew spawn run has no --model

2 participants