Repository navigation
Commit 60537f0
committed
fix(kiro): address review findings on completion suppression and failed exec wrappers
Three findings from the automated reviewers on cf1a572, each verified against
the code before changing it.
**Suppressing the resume wording was not sufficient (Codex P2).** The neutral
acknowledgement stopped the continuation text, but `completionMode` stayed
`required`, so the request kept advertising `codex_kiro_final_answer` together
with its instructions. The model then either answered again, or replied with
ordinary text and tripped `needsFallback`, whose retry payload ends with
`KIRO_COMPLETION_RETRY_MESSAGE` and explicitly reopens the finished task. A turn
whose history already ends with a delivered final answer now resolves to
`disabled`, so the completion contract is not offered at all.
Detection reads the parsed messages via `hasTrailingDeliveredFinalAnswer`, since
the mode is needed to build the tool catalog before the turn list exists. It
mirrors the turn-merge rule: a tool call in that message, or any later user or
tool-result message, means work continued. `forcedCompletionMode` still wins, so
the fallback retry that passes `text_fallback` is never silently downgraded.
**Internal state was inferred from user content (CodeRabbit).** The
acknowledgement was recognized by comparing `currentUim.content` to the constant,
so a genuine user message quoting that sentence was treated as proxy filler and
lost both its thinking-tag injection and its completion retry. The generated turn
now carries an `answerDeliveredAck` flag that survives the `currentTurn` pop, and
the checks test the flag.
**A failed exec wrapper was normalized as an empty success (Codex P2).**
`Script failed\nWall time ...\nOutput:\n` matched the success regex, so the only
failure signal was replaced with text claiming the cell completed, was not
blocked, and should not be retried — reachable through Responses history, where
`function_call_output` is parsed with `isError: false`. `Script failed` is out of
the shared success regex and gets its own failure guidance. Cursor keeps the
broader behavior through a local wrapper arm, because its Computer Use branch
marks such results `isError` separately and its suite pins that.
Verification: `bun x tsc --noEmit` clean; 203 tests pass across kiro-adapter,
kiro-stream, cursor-exec-empty-result, cursor-toolresult-normalize and
server-kiro-completion-e2e; privacy:scan, core-lab-boundary and repo-hygiene
green. Each of the three new assertions was driven red by reverting its fix
individually.1 parent cf1a572 commit 60537f0
4 files changed
Lines changed: 153 additions & 13 deletions
File tree
- src/adapters
- cursor
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
| |||
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
79 | | - | |
| 89 | + | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
86 | | - | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
16 | 31 | | |
17 | 32 | | |
18 | 33 | | |
| |||
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
65 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
66 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
349 | 361 | | |
350 | 362 | | |
351 | 363 | | |
| |||
360 | 372 | | |
361 | 373 | | |
362 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
363 | 396 | | |
364 | 397 | | |
365 | 398 | | |
| |||
467 | 500 | | |
468 | 501 | | |
469 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
470 | 514 | | |
471 | | - | |
| 515 | + | |
472 | 516 | | |
473 | 517 | | |
474 | 518 | | |
| |||
636 | 680 | | |
637 | 681 | | |
638 | 682 | | |
| 683 | + | |
639 | 684 | | |
640 | 685 | | |
641 | 686 | | |
| |||
651 | 696 | | |
652 | 697 | | |
653 | 698 | | |
| 699 | + | |
| 700 | + | |
654 | 701 | | |
655 | 702 | | |
656 | 703 | | |
| |||
681 | 728 | | |
682 | 729 | | |
683 | 730 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
688 | 735 | | |
689 | 736 | | |
690 | 737 | | |
691 | 738 | | |
692 | 739 | | |
693 | | - | |
| 740 | + | |
694 | 741 | | |
695 | 742 | | |
696 | 743 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
340 | 356 | | |
341 | 357 | | |
342 | 358 | | |
| |||
388 | 404 | | |
389 | 405 | | |
390 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
391 | 455 | | |
392 | 456 | | |
393 | 457 | | |
| |||
0 commit comments