fix(chat): remove follow-up options only from generated suffix - #6092
Conversation
|
👋 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:
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. |
1 similar comment
|
👋 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:
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. |
bolichen97
left a comment
There was a problem hiding this comment.
Blocking: the description presents this as the two indexOf-to-lastIndexOf edits in ChatPage, but the current main-targeting diff also contains the app-backend liveness implementation and its tests from the preceding commit (src/kiro_crew/apps/backend.py plus two backend test files). Please rebase/split that unrelated change out, or explicitly describe and justify the combined scope and update the evidence.
|
👋 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:
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. |
1 similar comment
|
👋 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:
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. |
|
Full-diff overlap audit (current head The residual is still valid: changing the follow-up session lookup from |
|
👋 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:
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. |
4 similar comments
|
👋 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:
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. |
|
👋 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:
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. |
|
👋 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:
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. |
|
👋 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:
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. |
Searching for the last matching label still corrupts earlier draft text when a user manually deletes the appended option before unselecting it. Rebuild only the complete ordered suffix generated from the picked option set, and leave edited text untouched when that suffix no longer exists. Fixes kirodotdev#5897
e9fde57 to
5a5088b
Compare
Resolved on 5a5088b: the unrelated app-backend commit and all backend diffs were dropped; the PR is now one ChatPage suffix commit with matching tests and description.
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Whole-suffix matching is the right shape: fail-safe toward leaving the draft alone, proportionate, and pinned by deterministic regression tests. Watch
[DESIGN-REVIEWED] 5a5088b |
UX Review (Fable 5, fork) — ✅ PASSUX-level review of The patch is a targeted behavioral fix: unselecting a follow-up chip previously spliced the first UX-Verdict: PASS Unselecting a chip can no longer silently rewrite the user's draft; the conservative fallback keeps visible chip feedback and never touches edited text. [UX-REVIEWED] 5a5088b |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of The review is complete. The fix in ChatPage is sound and cause-level, but the identical toggle in First-Principles-Verdict: CONCERNS The ChatPage fix is cause-level, but the identical toggle in ChatPane still uses the What this change shipsIntent: unselecting a suggested-answer chip must never rewrite the user's draft text — a FIX.
Watch
[FIRST-PRINCIPLES-REVIEWED] 5a5088b |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: removes follow-up options only from the generated ordered suffix (ChatPage), fixing a substring-match that corrupted an earlier ', Go' in the user's own draft — pure input-string edit, no security surface. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: replaces substring removal of a follow-up option with removal of the complete generated suffix, so an earlier match inside the user's own draft is no longer spliced; covered by two regression tests. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: the follow-up-options stripper ran over the whole message body, so an options-shaped line the user themselves wrote was removed — root cause is the unscoped match in ChatPage.tsx; fix confines removal to the generated suffix, with a toggle regression test. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
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. |
…ip un-toggle ChatPane's follow-up chip toggle spliced the LAST occurrence of ", <option>" out of the composer. Once the user has deleted the appended tail by hand, that search reaches back into their own draft: "Discuss, Alpha home" with a still-lit "Alpha" chip becomes "Discuss home". ChatPage was rewritten for this (kirodotdev#6092 review) to remove only the complete generated suffix, still intact at the end, and leave the draft alone otherwise. Port that block so the two panes agree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Problem / Motivation
ChatPage's follow-up option toggle used substring search when removing an option. A matching fragment inside the user's draft could be deleted instead of the text generated by the toggle. A simple
lastIndexOfstill corrupts an earlier, Goif the user manually removes the generated tail before unselecting the chip.Why it matters
Unselecting a suggested answer must never rewrite unrelated draft text. Draft corruption can silently change what the user sends, and the bug becomes especially easy to trigger with short options such as
Go.What changed
Tests
Please, Google, Gounselecting back toPlease, Google.Discuss, Go homeuntouched.lastIndexOfimplementation was mutation-checked and deterministically failed the edited-tail case.No retry, sleep, timeout increase, or flaky-test suppression was used.
Manual verification
N/A — the interaction state machine is covered directly with the real ChatPage component and fake timers.
Screenshots / video
Why no screenshot: This fixes composer text mutation without changing rendered layout or styling; the before/after behavior is pinned by the interaction tests above.
Related Issues
Fixes #5897