Repository navigation
Conversation
|
Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
Once you have rebased onto current main and settled the baseline-backend contract, the pipeline will re-assess on its next cycle. If you would prefer no automation on this PR, add the pr-no-autofix label. |
bolichen97
left a comment
There was a problem hiding this comment.
Description / code mismatch
Four claims in the Description are contradicted by the code on f04a43160: the harness-parity approach it promises is inverted in the diff, the parity-gate pass it reports cannot hold against that same diff, and the OpenCode setup link it describes references an i18n key that exists in no catalog.
1. Kiro-specific gates are bypassed with not is_kiro_backend, the exact form the Description promises never to use
The Description says —
Bypass Kiro-specific gates only when
acp_backend == "opencode"(positive check, nevernot is_kiro).
The code does — four added lines express harness identity negatively:
src/kiro_crew/providers/acp.py:1484—not is_kiro_backendsrc/kiro_crew/providers/acp.py:1208—not is_claude_backendsrc/kiro_crew/acp/client.py:2444— a negative identity test the branch's own widened rule matchessrc/kiro_crew/dashboard/handlers/agents.py:1081—!= ACP_BACKEND_OPENCODE
Risk — H5 is the invariant this change is most directly governed by (AGENTS.md, Harness parity: "Identity is positive... Never a bare string literal, an inequality, or a negation"), and it fails toward the permissive answer: not is_kiro_backend and != ACP_BACKEND_OPENCODE silently hand a fifth harness whatever branch they guard, with nothing going red until an operator who never opted into that harness pays for it. scripts/check_harness_parity.py does pin all four — the negative-identity rule catches the three in providers/acp.py and acp/client.py, and the negative-constant rule (!=\s*ACP_BACKEND_[A-Z_]+) catches agents.py:1081. All four are added lines under SCAN_ROOTS = ("src/kiro_crew/",) with no harness-ok suppression and no exempt= entry, so the diff-scoped gate reports four H5 violations (see finding 2). The harness-parity.md H6 row this PR edits cites test_acp_backend_opencode.py::TestOpenCodeProviderBoundaries, which pins H6's capability-set exclusions and is not a waiver for H5.
providers/acp.py:1484 additionally changes existing KAS behaviour that the Description does not disclose: cleanup_session no longer deletes ~/.kiro/sessions/cli/<sid>.json* for the KAS backend, which previously reached that code.
Required change — rewrite all four as positive tests or named-set membership: self.is_kiro_backend, provider.acp_backend == ACP_BACKEND_OPENCODE, self._is_opencode. For providers/acp.py:1208, the positive restoration of the early-return guard is if self.is_acp_runtime_backend or self.is_opencode_backend: return, or invert the block onto if self.is_claude_backend: — not a bare negation of either. If the KAS cleanup skip is intended, state it in the Description and in docs/system-specs/modules/harness-parity.md.
2. The reported check_harness_parity.py pass cannot hold — the gate matches four added lines
The Description says —
HARNESS_BASE_REF=origin/main python scripts/check_harness_parity.py✓
The code does — the gate matches the four lines listed in finding 1. Three of them fail under main's unmodified rules: dashboard/handlers/agents.py:1081 hits the untouched negative-constant rule, and providers/acp.py:1208 and providers/acp.py:1484 hit main's existing is_(?:kiro|claude|kas)_backend alternation. Only src/kiro_crew/acp/client.py:2444 depends on this branch's own widening of _HARNESS_LITERAL and negative-identity to include opencode — so the branch adds a line that its own tightening then catches.
Risk — the Harness Parity Gate job (.github/workflows/ci.yml:405-429, which exports HARNESS_BASE_REF from the PR's base.sha, runs --test, then the enforcing invocation) did not execute on this head SHA; the check-runs present are limited to the fork workflow guards, Fork PR Description, and readiness signals, which is a consequence of the fork plus the dirty merge-ref state rather than anything the author did. That leaves the reported ✓ as the only evidence a reviewer has for the invariant most central to this change, and it does not hold.
Required change — fix the four lines per finding 1, then re-run HARNESS_BASE_REF=origin/main python3 scripts/check_harness_parity.py and update the Tests section with the real result.
3. The OpenCode setup link has no catalog key, so it renders a raw dotted path and the PR's own new test cannot pass
The Description says —
KiroPrerequisiteGatequeriesacp_backend;opencoderenderschildrendirectly, otherwise showsOr use OpenCode → Continue with OpenCode(patchConfig('agent.acp_backend','opencode'),opencode.ai/docslink,opencode auth logincopy block, private-error redaction)
The code does — website/src/components/KiroPrerequisiteGate.tsx:1016 calls i18nT('components.kiroPrerequisiteGate.open_opencode_setup'), and that key is defined in no catalog, including en.json. Separately, the diff to this component is purely additive — the switchBackendMutation plus the card — and contains no acp_backend query and no early return children; the opencode bypass is served only by the backend returning ready: true, not by the component. The Description's third claimed new test, bypass when opencode, is absent from the test diff, which adds only switches to OpenCode and keeps first-run setup visible.
Risk — three concrete failures. (1) The opencode.ai/docs link renders as the literal text components.kiroPrerequisiteGate.open_opencode_setup on the first-run setup screen. (2) The new test switches to OpenCode from first-run setup and renders the dashboard opens with await screen.findByRole('link', { name: 'Open OpenCode setup' }), and website/integration/setup.ts — which is the setupFiles entry for the entire vitest project (website/vite.config.ts:591), not just integration tests — calls initI18n('en') against the real catalog, so that query never resolves. (3) frontend-lint runs npm run i18n:check (.github/workflows/ci.yml:1420), whose runner website/scripts/i18n-check.mjs spawns check-i18n-keys.mjs; its key-refs row is declared scope: 'repo', enforce: 'hard-zero' at website/scripts/lib/i18n-gate-table.mjs:111, and a t() naming a key that does not exist fails the step.
Required change — add open_opencode_setup under components.kiroPrerequisiteGate with the intended copy, then run cd website && npm run i18n:check and the vitest file. Either implement the component-side acp_backend query and early return children the Description describes, or correct the Description to say the bypass is backend-only, and either add the bypass when opencode test or drop it from the Tests section.
4. New English catalog keys with none of the shipped target catalogs updated
The Description says —
AgentBackendTab.tsx4th row backed byselectable_backend_values(),en.json+ tests
The code does — six keys are added to the English catalog only: five under the hunk @@ -4349,7 +4349,12 @@ at website/src/i18n/locales/en.json:4353-4357 (line 4352 is the modified your_crew_is_almost_ready), plus "opencode": "OpenCode" at website/src/i18n/locales/en.json:6354. No target catalog is touched. A seventh key, components.kiroPrerequisiteGate.open_opencode_setup, is referenced but added to no catalog at all (finding 3).
Risk — this contradicts the checklist item "[x] Existing tests pass and new tests added for new functionality": frontend-test reds on the catalog-parity cases, which cover 12 non-en codes rather than 11, because en-XA is itself a SUPPORTED_LANGUAGES entry (devOnly) and the parity loop includes it. The pseudolocale check (gen-pseudolocale.mjs --check, another hard zero) derives en-XA.json from en, which is unchanged here, so it fails as well.
Required change — add the new keys, translated, to every target catalog; place hand-authored strings in en.manual.json rather than the generated en.json; regenerate en-XA.json; then run cd website && npm run i18n:check && npm run test.
Audit note — three open PRs are building the same ACP-harness seamThis is a consolidation request, not a duplicate finding: #5349, #6307 and #6777 What the audit verified by reading all three merge-base diffs:
Why this needs a decision rather than a merge orderThe three collide inside the same functions, not merely in the same files, and each pins its Two things must not be lost whichever design winsFrom #5349, carry before consolidating: (1) website/src/pages/settings/AiBackendPanel.tsx plus website/src/test/AiBackendPanel.test.tsx -- the Settings -> System -> AI Backend picker with per-backend descriptions and the restart/new-chat disclosure (aiBackendPanel.restart_new_chats_description), together with its command-palette wiring in website/src/components/commandPalette/settingsRegistry.gen.ts and settingsTabLabel.ts; this is closer to the maintainer's 'the provider switch has its own page, keep consistent with the internal version' than #6307's preview-gated Developer -> ACP Adapters tab (AcpBackendCard.tsx). (2) src/kiro_crew/dashboard/kiro_readiness.py::running_backend_requires_kiro_prerequisite -- keep its fail-closed rule (an absent or unknown backend still demands kiro readiness) as the behaviour #6307's live resolver must preserve. (3) src/kiro_crew/cli_doctor.py's actionable codex rows ('Codex ACP adapter not found', Fix: npm i -g @agentclientprotocol/codex-acp), folded into acp/doctor.py::_report_adapter, and reused as the basis for the missing agent_sdk/backend_install.py codex probe that landed main names as codex's selectability blocker. (4) From test/test_acp_backend_codex.py, the design-independent cases only: codex advertised-model gating, session/new MCP descriptor wiring, session resume, and the auth-required / readiness boundary. Do NOT carry CodexAcpClient, CodexAcpProvider / create_codex_provider_factory, the create_factory codex branch, the ACP_BACKENDS_SELECTABLE edit, CODEX_EFFORT_CONFIG_ID = 'reasoning_effort', or the restart-only SessionManager.acp_backend snapshot -- each is superseded by, or contradicted by, landed main. One security-relevant noteNothing needs harvesting for a closure - neither PR is closed. For the consolidation, two items must not be lost whichever design wins. From #6307: src/kiro_crew/acp/opencode.py's ensure_routed_settings() with PERMISSION_ASK / PERMISSION_BYPASS_VALUES, which writes Suggested next step: a maintainer picks the seam design (the registry-dispatch shape vs. the From a repository-wide duplicate/overlap audit of every pull request open against |
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
|
@knowlet Thanks for this, and sorry for the long wait. OpenCode is still absent from Still unique to this PR: the sanitized Please rebase and narrow to that remaining scope. Two blockers regardless: #9013 (@atomsbaza) registers the same backend on the landed registry but keeps it known-and-not-selectable, citing a live probe showing OpenCode's ACP surface exposes no permission mode. I suggest landing that registration first, then rebasing this PR's OpenCode-specific work on top. Could you two settle selectability here? Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong. |
Head branch was pushed to by a user without write access
f04a431 to
20783ea
Compare
|
Intent: Make the dashboard offer OpenCode's own advertised models and cached choices, without requiring Kiro sign-in or querying kiro-cli. Reuse the existing advertised-model assembly while preserving Codex behavior. |
Keep the OpenCode picker independent of Kiro sign-in and its catalog. Reuse the existing advertised-list assembler for Codex and OpenCode, with namespace isolation and regression coverage for both paths.
bafe7f4 to
7082a01
Compare
|
|
|
|
|
|
|
|
@bolichen97, 7082a01 is rebased onto upstream Core OpenCode support is already supplied by #10006. I checked the competing model-related work too: #10414 changes the foreign-backend 503 explanation, but does not retrieve OpenCode's advertised/cached model catalog. On clean upstream, both new API regression cases still fail because OpenCode reaches Kiro readiness; the same cases pass with this patch. Replies to the four concerns in your changes-requested review:
Your later rebase-and-narrow request is reflected in the current scope: no harness registration, selectable-backend set, governance scope, MCP projection, transport, shared readiness/prerequisite implementation, or install-flow changes remain. The OpenCode model-list route runs before the existing Kiro readiness check. Codex and OpenCode share the existing advertised-model assembly through namespace-specific wrappers instead of duplicating it. This supersedes my earlier seven-file/two-commit description and OAuth credential claim. All OAuth changes are withdrawn from this PR. The existing OpenCode-process/plugin credential boundary is not claimed fixed, and no real OAuth isolation has been verified. The description contains the current local verification and its limits. The GitHub checks and reviews for 7082a01 are the authoritative new-head results; earlier CI runs are not reused as proof. Please re-review the current models-only diff and the separate scope question on the OAuth finding. |
|
self-added: yes
|
First Principles follow-up: real OpenCode catalog/cache smokeThe requested real The probe sent only All HOME/XDG/Crew paths and the project were temporary, the child environment was allowlisted, personal-home reads were OS-denied except the literal CLI binary, and external networking was OS-denied. OpenCode requires an internal HTTP listener before ACP initialization, so the probe allowed only one fixed loopback TCP port, with a random per-child server password. The earlier no-network attempt could not initialize; it is not counted as a pass. Both owned child processes were reaped; the ACP child was intentionally terminated after the assertions. This proves the anonymous bundled/public advertisement -> OpenCode cache -> picker data path, not account-specific entitlement, model inference, OAuth isolation, or a complete gateway/admission boot. It adds no source changes or new CI revision. |
|
@bolichen97, the models-only revision
The author decision is to keep only the independently reproduced OpenCode model-list bug after #10006, with the entire OAuth proposal withdrawn. The description matches that scope. Your existing |
Problem / Motivation
The dashboard asks Kiro for models when OpenCode is selected. A signed-out Kiro account can therefore block an OpenCode model picker, and a signed-in account can supply models OpenCode does not advertise.
Why it matters
OpenCode users need choices from their own backend. OpenCode ACP support is already provided by #10006; this PR fills the remaining dashboard model-list gap.
What changed (motivation → approach → change)
GET /api/modelshandles OpenCode before Kiro's sign-in check and catalog subprocess. Its choices come from the newest non-empty OpenCode session advertisement, then OpenCode's saved advertised-model cache.The dashboard handler (
src/kiro_crew/dashboard/handlers/agents.py) shares Codex's existing list assembly through namespace-specific wrappers. This preserves model ID spelling, metadata, exact-ID deduplication, context-window enrichment, and theautodefault. A configured pin is offered only when no advertised catalog is known. Kiro and Claude keep their existing paths.autofirstautofirstautoand the pinautoalone🟨 changed · 🟥 removed. OpenCode choices no longer depend on Kiro sign-in or Kiro's catalog.
The owning
docs/system-specs/modules/learn-cron-dashboard.mddocuments this contract. No credential policy, OAuth custody, backend admission, install flow, frontend component, locale catalog, or workflow changes are included.Tests
test/test_api_models_opencode.pycovers source order, namespace isolation, model IDs and metadata, sentinel handling, and configured pins. The API regression cases assert that OpenCode never checks Kiro readiness or prepares/spawns a catalog process. Existing Codex tests are unchanged.a828bf834: both API cases fail withAssertionError: OpenCode must not check Kiro readiness(2 call failures, 0 errors); the same cases pass with this patch.a828bf834: 103,559 passed, 420 skipped, 9 xfailed; exit 0. It ran unchanged in a non-root Ubuntu 24.04 / Python 3.12.14 container with seeded pip, CI prerequisites, process reaping and a temporary filesystem. No tests were manually narrowed or skipped.Manual verification
The API boundary was exercised directly with isolated configuration, fake live advertisements, and namespaced cache data.
A real OpenCode 1.18.23 process returned seven models through
initializeandsession/new. Its unmodified response passed through Crew's existing capture and persistence methods. After disk reload, only theopencodenamespace held those seven IDs, and the cache-only picker returnedautoplus the exact IDs. The protocol/cache smoke evidence records the isolated homes, fixed loopback-only listener and limits. This is not a complete gateway/admission boot or account-specific entitlement test. No provider login, model inference, or OAuth flow was performed.The frontend build, static assets, and Chromium i18n render gate were verified; the renderer reported existing baseline debt, not a new rendering change from this patch.
Screenshots / video
N/A — no frontend component, layout, label, or style changes. The fix changes the backend data source; the API assertions above verify the returned choices.
Related Issues
no linked issue: this is a focused dashboard follow-up to the OpenCode support merged in #10006.
Pattern harvest
Rule candidate: review-prompt
Pattern: Every selectable backend that owns an advertised model namespace needs an explicit model-list route; it must not inherit another backend's authentication or catalog lookup.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)