Skip to content

fix(instances): name instances.mint_timeout_secs on a mint timeout - #20381

Merged
mbriones98 merged 1 commit into
mainfrom
fix/mint-timeout-names-setting-19882
Oct 15, 2026
Merged

mbriones98 merged 1 commit into
mainfrom
fix/mint-timeout-names-setting-19882

Conversation

@mbriones98

@mbriones98 mbriones98 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When a Remote Crew token mint times out, the error names instances.mint_timeout_secs and the likely cause for its transport, so the user knows the next step.

A Remote Crew connect runs two timed steps. The forward readiness wait already names instances.connect_timeout_secs when it runs out with the tunnel still connecting. The token mint does not: over SSH it raises timed out minting token on <host> after <N>s, and over SSM it raises timed out minting token on <target> over SSM. Neither names the setting that budgets the mint.

Why it matters

A user on a slow jump host, proxy or SSM agent who raises the connect budget can then hit the mint timeout. The message gives them no setting to change, so they cannot connect without reading the source.

Not a goal

  • Changing either mint default, the floor or the ceiling.
  • Changing the forward readiness wait message.
  • Changing any other mint failure message (spawn failure, non-zero exit, missing token).

What changed (motivation → approach → change)

Symptom: both mint timeout messages end without a next step. Cause: the two TokenMintError timeout branches raise a bare message.

  • instances/token_mint.py: new _mint_timeout_advice(timeout_secs) returns the shared next step. Below MINT_TIMEOUT_CEILING_SECS it names kirocrew config set instances.mint_timeout_secs <value>. At the ceiling it tells the user to check that the host is reachable, because the config loader clamps the setting there. Below the ceiling it also says the one setting applies to SSH and SSM mints alike, so a value picked for a slow SSH host does not silently lower an SSM crew's budget below its 90s default.
  • instances/token_mint.py: the SSH timeout message keeps its prefix, then says that a host reached through a jump host or proxy pays that handshake again for the mint, and that otherwise the host may not be answering, then the advice.
  • instances/ssm_token_mint.py: the SSM timeout message keeps its prefix, adds the polling budget in seconds, names slow SSM command dispatch or a target whose SSM agent is not online, then the advice.

The wording follows the hedged style that open PR #19615 gives the readiness timeout: it names both possible causes and does not assert either.

Backwards compatibility

Compatible: only the text of two exception messages grows; each keeps its existing timed out minting token on ... prefix, so the existing match="timed out minting" test and any log search still match.

Removes nothing: the change only adds text to two error messages.

Tests

  • TestTokenMintGeneric::test_mint_timeout_names_the_mint_budget_setting (SSH): a hung mint at 30s names instances.mint_timeout_secs, the proxy cause and that the setting covers both transports; at the 120s ceiling it says the budget is at its maximum instead.
  • TestSsmMintOutputRedaction::test_ssm_mint_timeout_names_the_mint_budget_setting (SSM): a timed-out send-command at 90s names the setting, the polling budget and the SSM agent; at 120s it says the budget is at its maximum instead.

All four cases fail on origin/main and pass on this branch.

Manual verification

N/A: unit coverage sufficient: the change is message text on two exception branches, and both branches are driven directly by the tests.

Related Issues

Fixes #19882

Pattern harvest

Not generalizable: the readiness timeout on main still raises a bare message; open PR #19615 makes it name instances.connect_timeout_secs, and this PR applies the same wording to the two mint timeout branches. Together they cover every Remote Crew connect timeout.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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; see the Licensing section of CONTRIBUTING.md.

A Remote Crew token mint that runs out of budget raised a bare
"timed out minting token on <host>" message on both transports, so a
user on a slow jump host, proxy or SSM agent had no next step. Both
messages now name the likely cause for their transport and the setting
that budgets the mint. A budget already at the ceiling points at the
host's reachability instead, because the setting cannot go higher.
Defaults are unchanged.

Fixes #19882
@mbriones98
mbriones98 requested review from a team and KiroCrewCaptain as code owners October 14, 2026 16:48
@mbriones98
mbriones98 enabled auto-merge (squash) October 14, 2026 16:48
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] ea28340

Description read

[DESCRIPTION-READ] 43499d3a7e8086725f70af5e3539f35690e1f5a3fb8144f4fb4e9945c3312901

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision ea28340588aefb3e8655e166d2d41e744257f6cb 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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of ea28340588aefb3e8655e166d2d41e744257f6cb — 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: CONCERNS

The description says the readiness timeout "already names instances.connect_timeout_secs". It doesn't: ssh_tunnel_manager.py:1171 still raises a bare message, so this patch leaves one sibling unfixed.

Not justified as shipped

  • Item 3 — symptom-level: the PR's Pattern harvest says it is "Not generalizable: the readiness timeout already names its setting". On base, though, ssh_tunnel_manager.py:1171 sets f"timed out after {self._connect_timeout}s waiting for forward" and names no setting. A grep of src/kiro_crew for connect_timeout_secs inside a user-facing message found 0 hits. The root cause is the same: a timed step's timeout error does not name the config key that budgets it. The two mint branches are fixed and 1 sibling (the readiness wait) is not. ## Not a goal defers that sibling, but its stated reason rests on a false fact.
    Clears when: the description stops claiming the readiness wait already names its setting, or a human confirms the deferral knowing the message is still bare.

What this change ships

Inventory (3 items) — 2 justified

Intent: a user whose Remote Crew token mint times out can see which setting to raise and why. FIX (#19882; the new tests fail on base).

  1. An SSH mint timeout now names the likely proxy or jump-host cause and instances.mint_timeout_secs (or says the budget is already at its maximum) — justified
  2. An SSM mint timeout now names the polling budget, the SSM agent and the same setting — justified
  3. The forward readiness timeout is left without its setting, on a false "already names" premise — symptom-level: 1 counted unfixed sibling

[FIRST-PRINCIPLES-REVIEWED] ea28340

Description read

[DESCRIPTION-READ] e5ccc2ac206b15a2df096a3294389c5a6f6eadec72b5258e0623ea5801d25170

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ea28340

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

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

@mbriones98

mbriones98 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=d83fcede9a89: description claims the readiness timeout already names its setting

Outcome: accepted, description corrected; the readiness message itself stays out of this PR.
On main the readiness timeout at ssh_tunnel_manager.py:1171 is still bare. Open PR #19615 is the change that makes it name instances.connect_timeout_secs, and this PR leaves it alone on purpose (listed under Not a goal) so the two do not collide.
The Pattern harvest and the wording note in What changed now say this. The same sentence in Problem / Motivation is in a frozen section, so it stays as written: read it as true once #19615 merges.

self-added: no
mechanism: description claimed a sibling PR's change was already on main

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ea28340

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

@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 14, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at ea28340.

I found no defect. Both mint timeouts keep their timed out minting token on ... prefix and now name instances.mint_timeout_secs through one helper, _mint_timeout_advice. The helper switches to reachability advice at the 120s ceiling the config loader clamps to, and warns that the one setting covers SSM too. Both transports have a test for each case. The First Principles concern has a fair reply (the readiness-timeout sibling belongs to #19615), and CI is green.

This is a hold, not a request for changes: the PR edits the dashboard-token minting files instances/token_mint.py and instances/ssm_token_mint.py, which the maintainers' rule reserves for a human reviewer. Auto-merge is armed, so a maintainer approval will land it. — crew-pr-reviewer (r101)

@bolichen97 bolichen97 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.

Readiness sweep review: read the full diff (merge-base) and the PR thread. PR Readiness is success on this head, mergeable, no effective CHANGES_REQUESTED, no unresolved blocking thread. Mint-timeout error text only; prefixes preserved; merged-tree tests 127 passed. No regression to normal use found.

@mbriones98
mbriones98 merged commit f911a01 into main Oct 15, 2026
153 of 157 checks passed
@mbriones98
mbriones98 deleted the fix/mint-timeout-names-setting-19882 branch October 15, 2026 18:41
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 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.

fix(instances): name instances.mint_timeout_secs when a Remote Crew token mint times out

3 participants