Skip to content

fix(acp): name the seam, not the launcher, in spawn diagnostics - #11575

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Premshay:fix/adapter-spawn-label
Sep 22, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Premshay:fix/adapter-spawn-label

Conversation

@Premshay

@Premshay Premshay commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Both vendored adapters resolve to dist/index.js through node, so the spawn label read claude-agent-acp via .../dist/index.js -- the packaging, not the adapter -- and a bare interpreter added nothing useful. Suppressing that suffix on the basename alone also erased the one record of which build launched, whenever the override pointed the seam at a shim or a vendored build.

Why it matters

Spawn diagnostics name the packaging instead of the adapter, so logs and stderr prefixes mislead anyone tracing which engine actually launched.

What changed (motivation → approach → change)

Observed symptom → root cause → change: the label collapsed any script named index.js without asking whether it was the adapter package's own entry or one the operator's override supplied. Collapse the suffix only for that package entry under its own scope, and keep the full path for every other index.js; the stderr label remains the one the spawn already resolved, so the shared kiro path is untouched.

Backwards compatibility

Compatible: only diagnostic label text changes; no accepted input, configuration, or API contract is rejected, renamed, or removed.

Tests

test/test_acp_spawn_label.py -- 14 passed, including rows that pin the kept path for an override-supplied index.js and for a script that is not the adapter's packaged entry.

Manual verification

N/A -- unit coverage sufficient: the label-resolution branches are exercised by the spawn-label tests above.

Related Issues

N/A -- no existing issue covers adapter mislabeling in spawn diagnostics.

Pattern harvest

Rule candidate: review-prompt

Pattern: a diagnostic label must name the actor, not the launcher binary the actor happens to run under.

Checklist

  • Existing tests pass and regression coverage is included.
  • 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.

@Premshay
Premshay requested a review from a team September 17, 2026 19:05
@dwu96

dwu96 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 17, 2026
@dwu96

dwu96 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of ab09e7aa19f6828b40777d68c48fafc447ab5270 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the bare-interpreter reversal (via node → seam alone) is intended — the old test pinned the opposite and argv shape decides which log identity survives.

Suggestions

  • The resolution ladder already knows which candidate won (override vs vendored vs PATH); returning that provenance and passing it to _adapter_spawn_label would delete _named_by_override's spawn-time re-read of os.environ — which compares current env against a cached argv and normpath strings against possibly relative/symlinked overrides, so a post-resolution env change or symlinked override silently collapses the label the PR exists to preserve.

[DESIGN-REVIEWED] ab09e7a

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

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

Review details

FINDING -- src/kiro_crew/acp/client.py:464 -- relative overrides fail the "normpath" comparison after resolver canonicalization, collapsing the requested diagnostic path -> Fix: compare both paths using Path.resolve() and normcase().
[GPT-REVIEWED] ab09e7a

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

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

Review details

No findings block; one advisory finding.

FINDING — src/kiro_crew/acp/client.py:471 — _named_by_override compares the raw env string os.path.normpath(os.path.expanduser(override)) against program, but the resolver returns program = str(Path(script).resolve()) (client.py:923), so a deliberate override to the adapter's own package entry given as a relative path or through a symlink fails the equality test, then matches _is_adapter_package_entry and is collapsed to the bare seam — suppressing the very path the docstring and test_override_supplying_the_package_entry_keeps_its_path claim to preserve (the test only passes because its override is already absolute and unsymlinked, a .resolve() no-op) → Fix: compare canonically, e.g. Path(os.path.expanduser(override)).resolve() == Path(program).resolve() (guarded against resolution failure).

[OPUS-REVIEWED] ab09e7a

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

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

First-Principles-Verdict: CONCERNS

The "mislabeling" defect has no checkable provenance, and the collapse erases which installed copy launched — the very record the base pinned the suffix to keep.

Not justified as shipped

  • Item 1 — inherited: "Related Issues: N/A" — the defect exists only as the description's assertion, and its premise ("the packaging, not the adapter") is undercut by the diff's own test row, where the collapsed path .../node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js names the adapter. It reverses the base pin "node carries the entry script, so the full path distinguishes default packages" with argument, not evidence, and three resolution roots share that suffix (_vendor/node_modules, $KIROCREW_PROJECT_DIR/node_modules, global — client.py:806-855), so the bare seam erases which copy launched while the retained docstring still promises "the resolved program proves which adapter command that seam actually launched." _named_by_override's env re-read exists only to patch that self-inflicted loss.
    Subtraction: delete the collapse — _is_adapter_package_entry, _named_by_override, the pkg_entry/override_env parameters — keeping the base one-line label.
    Clears when: a linked issue or reproduction shows someone actually misled by the full-path label, or the collapse is deleted.
  • Item 3 — rides along: dead branch — _resolve_node_adapter_argv returns ["node", script] or [binary], never bare ["node"] — and it reverses the pin "A bare interpreter still identifies the exact command."

What this change ships

Inventory (6 items) — 3 justified

Intent: make spawn/stderr log labels name the adapter rather than its entry-script path — a FIX by framing, cosmetic in effect.

  1. Installed claude adapter's spawn and stderr labels drop via .../dist/index.js — inherited, reverses a base pin without evidence
  2. pi adapter spawn label collapses the same way — inherited (same root cause as item 1)
  3. Bare node argv now labels as the seam alone, was "via node" — rides along, dead branch, reversed pin
  4. Override-supplied entry scripts keep their full path in the label — rides along, exists only to patch item 1's information loss
  5. Kiro stderr test now exercises _drain_stderr's default label — justified
  6. Spawn-label tests renamed and re-documented — justified

Counts run: _adapter_spawn_label( has 3 call sites (client.py:7555, 7556, 7724), all updated; 3 node_modules roots produce the collapsed suffix.

[FIRST-PRINCIPLES-REVIEWED] ab09e7a

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 19, 2026
@Premshay
Premshay force-pushed the fix/adapter-spawn-label branch from 2250440 to c608167 Compare September 19, 2026 09:20
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 19, 2026
@Premshay
Premshay force-pushed the fix/adapter-spawn-label branch from c608167 to e46c027 Compare September 20, 2026 21:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@Premshay
Premshay force-pushed the fix/adapter-spawn-label branch from e46c027 to 38a897e Compare September 21, 2026 09:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 21, 2026
An adapter installed as a Node package resolves to its own dist/index.js, so
the spawn label read "claude-agent-acp via .../dist/index.js" -- the packaging,
not the adapter. Suppressing the suffix on the basename alone also erased the
one record of which build launched whenever CLAUDE_AGENT_ACP_BIN or
CODEX_ACP_BIN pointed the seam at a shim or a vendored build.

Restrict the suffix to the adapter package's own entry under its own scope, and
keep the full path for any index.js that an override supplied or that is not
that package's entry. The stderr label is the one the spawn resolved, so the
shared kiro spawn and drain path is unchanged.
@Premshay
Premshay force-pushed the fix/adapter-spawn-label branch from 38a897e to ab09e7a Compare September 22, 2026 21:26
@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 Sep 22, 2026
@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 Sep 22, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) September 22, 2026 23:07

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

Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, SAST clean (the single Semgrep annotation on this head SHA is GitHub's own notice-level ubuntu-latest runner-image banner at path .github, not a finding), security checklist all-NO, AI reviewers green. Design-doc gate clean. Category: the spawn diagnostic label named a packaged dist/index.js rather than the seam; the fix suppresses the path only for the adapter's own package entry and keeps it for an operator override or any other script. Log-label only. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with no real findings.

@iamwhatever
iamwhatever merged commit 6fcdfcb into kirodotdev:main Sep 22, 2026
96 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 22, 2026
wknight1 pushed a commit to wknight1/KiroCrew that referenced this pull request Oct 5, 2026
…dotdev#11575)

An adapter installed as a Node package resolves to its own dist/index.js, so
the spawn label read "claude-agent-acp via .../dist/index.js" -- the packaging,
not the adapter. Suppressing the suffix on the basename alone also erased the
one record of which build launched whenever CLAUDE_AGENT_ACP_BIN or
CODEX_ACP_BIN pointed the seam at a shim or a vendored build.

Restrict the suffix to the adapter package's own entry under its own scope, and
keep the full path for any index.js that an override supplied or that is not
that package's entry. The stderr label is the one the spawn resolved, so the
shared kiro spawn and drain path is unchanged.

Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com>
@Premshay
Premshay deleted the fix/adapter-spawn-label branch November 13, 2026 11:10
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.

3 participants