Repository navigation
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS This is a display-only port that matches the TS call site ( [DESIGN-REVIEWED] 2a6f18a Description read[DESCRIPTION-READ] 930cbdd33228bee38b45c6e3ee36efc23b895307ebade7f905acda75e0a47c4b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. A Python port of the dashboard's display decoder is added at the one native-path funnel ( What this change shipsInventory (3 items) — 3 justifiedIntent: Slack and Discord users see readable file names in tool titles, as the dashboard already shows them. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 2a6f18a Description read[DESCRIPTION-READ] 3e4a624f11f75561d783d12052d62eff193cc8372dad84eec63baca741322719 That sha256 names the PR description this verdict read. Recompute it with |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes on 22cf093. The goal, showing a%20b.md as a b.md in tool titles, is good, and decoding per segment with a fallback to the encoded form is the right shape.
The blocker is that decode_path_for_display in tool_call_title.py adds three new regexes in product code, _UNSAFE_DECODED_RE, _PERCENT_ESCAPE_RE and _MALFORMED_ESCAPE_RE, and uses them to decide whether and how a path is decoded. We don't take new regex-based parsing in product code. Please replace them with a structured check, for example:
- Escape check: walk the segment once. For each
%, require the next two characters to be in a hex-digit set; any other%means "keep the segment encoded". The same walk tells you whether there is any escape at all, so the early return needs no pattern either. - Unsafe decoded characters: a set of the separators, plus a check per character on the decoded text:
ord(c) < 0x20 or ord(c) == 0x7f, orcin an explicit set of the bidi controls (\u200e,\u200f,\u202ato\u202e,\u2066to\u2069). Or useunicodedata.category(c) in {"Cc", "Cf"}if the wider class is intended.
The test rows you already have should carry over unchanged, which shows the behaviour is the same.
All checks pass on this head; only PR Readiness is still running.
22cf093 to
6e22b2b
Compare
|
Updated on 6e22b2b, rebased onto current main.
|
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
Thanks for replacing the regexes: the hex-digit set and the explicit character set do the same job, the test rows carried over, and my earlier change request on 22cf093 is addressed. The code looks good to me on 6e22b2b. One step is left: could you update this branch onto main? Its merge base is behind main by 34 commits, and Backend Tests (3.12, 2) fails on Real Adapter Contract Tests also failed here on a runner sandbox error ( |
The Python title mirror in tool_call_title.py passed native tool paths to rel_display_path as written. A path such as drafts/The%20Power%20of%20Running.md showed as Edit drafts/The%20Power%20of%20Running.md in Slack and Discord task labels. The dashboard already decodes it through decodePathForDisplay in pathBasename.ts. Add decode_path_for_display, a port of decodePathForDisplay, and call it in classify_native's rel helper. Each segment decodes on its own. A segment keeps its encoded form when it has a malformed escape, is not valid UTF-8, or would decode to a separator, a control or a bidi character. The escape check walks each "%" and tests the next two characters against a hex-digit set. The unsafe check tests each decoded character against C0 controls, DEL and an explicit set of separators and bidi controls. No regex is used. New shared fixture cases pin the decoded titles and both guards on the Python and TypeScript sides. Closes kirodotdev#29871
6e22b2b to
2a6f18a
Compare
|
Thanks. I rebased the branch onto main at 89a6107, which includes 484ef40. It is one commit again (2a6f18a) with the same change, and the Proof line names the new head. The tool title tests pass locally on it (289 passed), so Backend Tests and the adapter contract tests should run clean on this head. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving head 2a6f18a. decode_path_for_display no longer uses a regex: _scan_escapes walks each %, _is_unsafe_decoded checks each decoded character, and the test rows carried over unchanged.
The one red lane, Real Adapter Contract Tests (test_codex_inner_sandbox_approval.py), is not this change: it fails the same way on other PRs cut from the same base, and #31758 fixed it on main. Could you rebase onto main? The push will dismiss this approval, and I will re-approve once it is green.
|
@bolichen97 the only red check on this head is Real Adapter Contract Tests. That is the sandbox loopback failure that #31758 fixed on main, and only a new head picks the fix up. A push here would turn off the auto-merge you enabled. Is it OK if I rebase onto main and push, so you can turn auto-merge back on? |
|
[operator: bolichen97] Continuing this in #38644; thanks for the start. |
|
Closing this in favour of #38644, which carries the fix forward. Thanks for picking it up. |
Pull request was closed
Problem / Motivation
classify_nativeinsrc/kiro_crew/tool_call_title.pypasses native tool paths torel_display_pathas written. For the pathdrafts/The%20Power%20of%20Running.md,derive_tool_call_titlereturnsEdit drafts/The%20Power%20of%20Running.md. The dashboard rendersEdit drafts/The Power of Running.mdfor the same call, becausetoolCallTitle.tsrunsdecodePathForDisplayfirst.Goal: Slack and Discord tool titles decode percent-escaped paths the same way the dashboard does.
Why it matters
Slack and Discord task labels come from this module. The module promises the same title as the dashboard for every call. Today a channel user sees
%20where the dashboard shows a space.Not a goal
Changing how files are opened or probed. The decoded text is for display only. Shell command titles are also unchanged, since the TypeScript side does not decode them either.
What changed
src/kiro_crew/tool_call_title.py: adddecode_path_for_display, a port ofdecodePathForDisplay, and call it in therelhelper ofclassify_native. A segment keeps its encoded form when it has a malformed escape, is not valid UTF-8, or would decode to a separator, a control or a bidi character.decode_path_for_displayuse no regex._scan_escapeswalks each%and tests the next two characters against a hex-digit set._is_unsafe_decodedtests each decoded character against C0 controls, DEL and an explicit set of separators and bidi controls.test/fixtures/tool_call_titles.json: add four shared cases, two decoded titles and two kept-encoded guards, so the Python and TypeScript suites both pin them.test/test_tool_call_title.py: add direct tests for decoded edit and read titles and for each per-segment guard.Tests
Proof: PROVEN test/test_tool_call_title.py::test_fixture_conformance[fs_write percent-encoded path is decoded for display], test/test_tool_call_title.py::test_fixture_conformance[fs_read percent-encoded path is decoded before cwd is stripped], test/test_tool_call_title.py::test_native_titles_decode_percent_escaped_paths_like_the_dashboard, test/test_tool_call_title.py::test_read_title_decodes_each_segment_like_decodePathForDisplay[x/a%20b.md-x/a b.md], test/test_tool_call_title.py::test_read_title_decodes_each_segment_like_decodePathForDisplay[ok%20dir/50%off.md-ok dir/50%off.md] (head 2a6f18a)
test_fixture_conformance[fs_write percent-encoded path is decoded for display]pinsEdit drafts/The Power of Running.mdon both sides.test_fixture_conformance[fs_read percent-encoded path is decoded before cwd is stripped]pins that decoding happens before the cwd prefix is removed.test_fixture_conformanceguard cases pin that%2Fand a malformed%ofkeep the segment encoded.test_native_titles_decode_percent_escaped_paths_like_the_dashboardpins the decoded edit and read titles.test_read_title_decodes_each_segment_like_decodePathForDisplaypins per-segment decoding and the separator, backslash, control, bidi, malformed and non-UTF-8 guards.Sibling sweep
Swept: every caller of
rel_display_pathandshort_display_pathundersrc/kiro_crew, and the TypeScriptclassifyNativeandreadFromKiroCliTitle.Sibling: src/kiro_crew/tool_call_title.py -- changed here
Sibling: src/kiro_crew/tool_call_title_shell_classify.py -- not affected -- shell titles use short_display_path, which the TypeScript side does not decode either
Sibling: website/src/utils/toolCallTitle.ts -- not affected -- it already decodes through decodePathForDisplay
Pattern harvest
Rule candidate: review-prompt
Pattern: When a fix lands in one half of a mirrored TypeScript and Python module, port it to the other half and add a shared fixture case.
Closes #29871