You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): long Workflows links no longer end in a broken character - #42617
The /workflows route reads env, run, and file from the address and caps each at 200 UTF-16 units with a plain slice(0, 200). When a parameter has 199 characters followed by an emoji, the cut splits the surrogate pair: the router rewrites the address to end in %EF%BF%BD, and the Workflows breadcrumb and editor path show a trailing replacement character.
To reproduce: enable Workflows in Settings > Labs, then open /workflows?definitions=true&file= with 199 characters followed by 😀 (or pass the same shape to env and run).
Change
Added a small local sliceParam helper in apps/web/src/routes/_chat.workflows.tsx that uses the shared splitsSurrogatePair from @t3tools/shared/assistantCitations (the same cut merged in #42228) and steps back one unit to 199 when unit 200 would split a surrogate pair. env, run, and file all go through sliceParam, while the 200-unit limit is unchanged.
Scope
A small fix for an obvious bug, so no issue is needed. It applies the same surrogate-safe cut merged in #42228 to the Workflows route.
Verification
An AI agent (Gemini 4 Neon and Claude Opus 5.5, T3 Code Nightly) ran each check:
New unit test apps/web/src/components/workflows/workflowsRouteSearch.test.ts: fails on base 4da8d19d08ed with env, run, and file each ending in a lone high surrogate, and passes on head 0987a6b0a129 (1/1 passed across 3 consecutive runs).
vp run check:changed upstream/main on 0987a6b0a129: exits 0 (format, lint, knip, typecheck across 2 packages, unit test, and React Compiler check all pass).
Live app check in T3's Browser panel: confirmed the trailing replacement character and %EF%BF%BD rewrite on base and clean 199-character truncation with no %EF%BF%BD or replacement character on head.
Setup: Linux, Chromium in T3's Browser panel, light theme, 2560x1600 capture, fresh isolated synthetic data, server named "Test machine".
Steps: Enable Workflows in Settings > Labs → open /workflows?definitions=true&file=<199 characters>😀 → read the breadcrumb and address.
62e8042b2124 (base)
0987a6b0a129 (head)
On 62e8042 the Workflows breadcrumb for a 199-character file name plus an emoji ends in a replacement character
On 0987a6b the same address keeps the 199 characters and drops the split emoji, with no replacement character
env and run were checked in the address the same way via /workflows?env=<199 characters>😀&run=<199 characters>😀 (no image): on base both were rewritten to end in %EF%BF%BD, and on head both stopped cleanly at 199 characters. The before capture is on 62e8042b2124; apps/web/src/routes/_chat.workflows.tsx, the Workflows components, and splitsSurrogatePair are byte-identical on 62e8042b2124 and on head's parent 4da8d19d08ed.
Not shown: The cut works per code point, so it can still split a grapheme cluster such as a flag or ZWJ sequence, but never half of a surrogate pair.
Reviewing files that changed from the base of the PR and between 0987a6b and 5f3b888.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The workflows route truncates nonempty env, run, and file search values to 200 characters without splitting surrogate pairs. A test checks values with an emoji at the truncation boundary.
Changes: Workflow search truncation
Layer / File(s)
Summary
Truncate and validate workflow search values apps/web/src/routes/_chat.workflows.tsx, apps/web/src/components/workflows/workflowsRouteSearch.test.ts
The route uses splitsSurrogatePair to keep env, run, and file values within a valid surrogate boundary when truncating to 200 characters. The test checks values with an emoji at that boundary.
Long query parameters on the Workflows route are now cut without leaving a broken trailing character. The change is narrow and covered by a test, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: Workflows links with long parameters no longer end in a broken character. It follows conventional commit form (fix(web)) and matches the changeset, which caps env, ru…
Description check
The description covers every template section. Problem gives the cause and reproduction steps. Change explains the sliceParam helper and the shared splitsSurrogatePair use. Scope says why no issue is …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: Workflows links with long parameters no longer end in a broken character. It follows conventional commit form (fix(web)) and matches the changeset, which caps env, run, and file at 200 UTF-16 units and steps back to 199 when the cut would split a surrogate pair. The title is concise and specific.
Full details: Description check
Explanation
The description covers every template section. Problem gives the cause and reproduction steps. Change explains the sliceParam helper and the shared splitsSurrogatePair use. Scope says why no issue is needed and cites the related merged PR #42228. Verification reports a failing-then-passing unit test, a passing check:changed run, and a live browser check with before and after screenshots. It also notes the agent-model attribution and a known limitation for grapheme clusters. The template's required structure is present and the content is specific.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Enable Workflows, then load generated links containing 199 ASCII characters followed by 😀 in env, run, and file. Repeat env and run with 198 letters followed by 😀 as the control. No file was saved. Real Chromium web client, fresh synthetic state, light theme, 2800×900 on both commits.
Base shows � in the environment name and file breadcrumb. Head drops the split emoji and leaves 199 letters. The intact emoji control remains intact. scenarios:prove exited 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
/workflowsroute readsenv,run, andfilefrom the address and caps each at 200 UTF-16 units with a plainslice(0, 200). When a parameter has 199 characters followed by an emoji, the cut splits the surrogate pair: the router rewrites the address to end in%EF%BF%BD, and the Workflows breadcrumb and editor path show a trailing replacement character.To reproduce: enable Workflows in Settings > Labs, then open
/workflows?definitions=true&file=with 199 characters followed by😀(or pass the same shape toenvandrun).Change
Added a small local
sliceParamhelper inapps/web/src/routes/_chat.workflows.tsxthat uses the sharedsplitsSurrogatePairfrom@t3tools/shared/assistantCitations(the same cut merged in #42228) and steps back one unit to 199 when unit 200 would split a surrogate pair.env,run, andfileall go throughsliceParam, while the 200-unit limit is unchanged.Scope
A small fix for an obvious bug, so no issue is needed. It applies the same surrogate-safe cut merged in #42228 to the Workflows route.
Verification
An AI agent (Gemini 4 Neon and Claude Opus 5.5, T3 Code Nightly) ran each check:
apps/web/src/components/workflows/workflowsRouteSearch.test.ts: fails on base4da8d19d08edwithenv,run, andfileeach ending in a lone high surrogate, and passes on head0987a6b0a129(1/1 passed across 3 consecutive runs).vp run check:changed upstream/mainon0987a6b0a129: exits 0 (format, lint, knip, typecheck across 2 packages, unit test, and React Compiler check all pass).%EF%BF%BDrewrite on base and clean 199-character truncation with no%EF%BF%BDor replacement character on head.Setup: Linux, Chromium in T3's Browser panel, light theme, 2560x1600 capture, fresh isolated synthetic data, server named "Test machine".
Steps: Enable Workflows in Settings > Labs → open
/workflows?definitions=true&file=<199 characters>😀→ read the breadcrumb and address.62e8042b2124(base)0987a6b0a129(head)On 62e8042 the Workflows breadcrumb for a 199-character file name plus an emoji ends in a replacement character
On 0987a6b the same address keeps the 199 characters and drops the split emoji, with no replacement character
envandrunwere checked in the address the same way via/workflows?env=<199 characters>😀&run=<199 characters>😀(no image): on base both were rewritten to end in%EF%BF%BD, and on head both stopped cleanly at 199 characters. The before capture is on62e8042b2124;apps/web/src/routes/_chat.workflows.tsx, the Workflows components, andsplitsSurrogatePairare byte-identical on62e8042b2124and on head's parent4da8d19d08ed.Not shown: The cut works per code point, so it can still split a grapheme cluster such as a flag or ZWJ sequence, but never half of a surrogate pair.
Generated with Gemini 4 Neon in T3 Code Nightly