Skip to content

fix(kiro): preserve task continuity and native boundaries - #2

Merged
coseung2 merged 3 commits into
mainfrom
fix/kiro-task-continuity-20260912
Sep 12, 2026
Merged

fix(kiro): preserve task continuity and native boundaries#2
coseung2 merged 3 commits into
mainfrom
fix/kiro-task-continuity-20260912

Conversation

@coseung2

@coseung2 coseung2 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fix three deterministic Kiro continuity gaps that could make completed work repeat: unexplained empty code-mode output, bounded tool catalogs dropping the execution path, and a fork-only optimization deleting assistant commentary from later tool rounds and compaction context.

Then structurally separate the Kiro direct-native integration so task-memory policy cannot accidentally be changed by auth/transport or wire-codec work. This PR intentionally targets coseung2/opencodex:main.

Upstream investigation

  • lidge-jun/opencodex#2819: empty exec-output guidance was missing from the fork while delivered-final termination was already present.
  • lidge-jun/opencodex#2407, #2475, #2750: searched-tool priority and the code-mode execution-path reservation were missing.
  • Existing #2835, #3012, #3031, and #3750 completion/result ownership behavior is preserved.
  • Fork-only commit 037a30984 blanked every Responses phase=commentary message before rebuilding Kiro history. Current upstream preserves assistant text; this PR reverses only the memory deletion and keeps the useful anti-repeat instruction.

Functional changes

  • Explain explicit text(...) / notify(...) output semantics so an empty successful exec cell is not interpreted as lost context.
  • Preserve discovered tools and the freeform exec route inside Kiro count/byte limits.
  • Preserve assistant commentary as Kiro input history so decisions, completed steps, rejected hypotheses, and next actions survive tool-result rounds and routed checkpoint compaction.
  • Keep historical commentary input-only; it is not automatically re-emitted by the stream parser.
  • Preserve errors, image evidence, original-id result grouping, delivered-final termination, blocking questions, redacted reasoning, and cancellation semantics. No command is automatically re-executed.

Native provider boundaries

Kiro remains a direct CodeWhisperer GenerateAssistantResponse integration, not another proxy hop. The former 2,163-line kiro.ts is split behind the stable adapter surface:

  • kiro-continuity.ts: delivered-final/completion/fallback policy only; no network/auth.
  • kiro-codec.ts: canonical history <-> Kiro conversationState and AWS eventstream <-> AdapterEvent; no credential resolution or retry/fetch import.
  • kiro-transport.ts: region/profile selection, CLI-vs-IDE envelope, native headers/endpoint, image-normalized serialization, retry-aware fetch, and stream-throttle cooldown recording.
  • kiro.ts: 191-line ProviderAdapter facade that composes the three layers and retains stable exports.

tests/kiro-architecture-boundary.test.ts pins these dependency rules. The detailed staged plan, invariants, rollback strategy, and implementation outcome are in devlog/_plan/260912_kiro_native_boundaries/000_plan.md.

Validation

  • Final focused Kiro/Responses/compaction/auth/transport/architecture matrix: 357 pass, 0 fail, 1,206 assertions across 12 files.
  • Architecture boundary regression: 4/4 pass; it was written first and failed against the monolithic layout.
  • Repository hygiene: 10/10 pass, 17 assertions.
  • Typecheck: passed.
  • Privacy scan and git diff --check: passed.
  • Frozen docs install/build: passed, 231 pages, no lockfile changes.
  • Security review: compared native auth/header/endpoint construction directly with pre-refactor commit a3f0fbe54; token selection, Builder-ID/profile handling, region/custom endpoint behavior, headers, diagnostics, and retry semantics are unchanged. No new credential source, network destination, permission, request-body logging, or account mutation was introduced.
  • Repository-wide validation is not claimed green. Earlier baseline work reproduced three unrelated shutdown-launcher startup-health failures on clean main. A post-refactor full run with a 240-second ceiling made steady progress but timed out in oauth-refresh-lock-multiprocess.test.ts before an aggregate was produced (exit 124).

Scope and deployment

No real Kiro account request, credential mutation, deployment, merge, or operational restart was performed. The synthetic regressions prove the adapter contracts but do not claim every possible live model loop has the same cause.

Detailed evidence:

  • devlog/_plan/260912_kiro_task_continuity/000_findings.md
  • devlog/_plan/260912_kiro_native_boundaries/000_plan.md

Adapt upstream empty-exec output and tool-catalog retention fixes while preserving fork replay/terminal behavior. Normalize only paired code-mode results after adjacent grouping; reserve exec without bypassing count or byte budgets. Add regression coverage and English/Korean troubleshooting guidance.
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

PR quality gates passed

This pull request now targets main with acceptable ancestry and description.

The [WRONG BRANCH] title prefix has been removed. The pull request has been marked ready for review again.

@github-actions github-actions Bot changed the title fix(kiro): preserve code-mode task continuity [WRONG BRANCH] fix(kiro): preserve code-mode task continuity Sep 11, 2026
@github-actions github-actions Bot added the bug Something isn't working label Sep 11, 2026
@github-actions
github-actions Bot marked this pull request as draft September 11, 2026 20:49
@coseung2

Copy link
Copy Markdown
Owner Author

Validation note: the inherited enforce-target workflow fails with PR quality gate failed: wrong base (main). This PR deliberately targets the user fork main, not upstream dev, as requested by the fork workflow. The common checks, React Doctor, and the observed GUI Linux/macOS checks passed; platform jobs were still running when inspected. No branch policy, workflow permission, or check bypass was changed to hide this failure. The local full-suite limitations and baseline launcher reproduction remain documented in the PR body.

@coseung2
coseung2 marked this pull request as ready for review September 12, 2026 00:47
@github-actions github-actions Bot changed the title [WRONG BRANCH] fix(kiro): preserve code-mode task continuity fix(kiro): preserve code-mode task continuity Sep 12, 2026
Keep Responses commentary in Kiro history so tool-result continuations and checkpoint compaction retain decisions, completed work, and next steps. Preserve the anti-repeat completion contract and prove historical commentary is input-only rather than automatically re-emitted.
Split Kiro task-continuity policy, bidirectional CodeWhisperer codec, native auth/transport, and the stable ProviderAdapter facade without changing provider behavior. Add architecture-boundary tests and document the dependency rules, validation, rollback, and security review.
@coseung2 coseung2 changed the title fix(kiro): preserve code-mode task continuity fix(kiro): preserve task continuity and native boundaries Sep 12, 2026
@coseung2
coseung2 merged commit 0b85bfa into main Sep 12, 2026
17 checks passed
@coseung2
coseung2 deleted the fix/kiro-task-continuity-20260912 branch September 12, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant