Skip to content

fix(shared): accept a trailing slash on hosted /new/ prompt links - #47549

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-3dd7dd5755
Dec 2, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-3dd7dd5755

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

When the desktop app receives a hosted new-thread prompt URL with a trailing slash in its launch arguments, it drops the link before sending it to the renderer. The URL should open the same prompt draft as the slashless form.

Deterministic repro on origin/main (0353e276be35d8ab1a84d0d009db8c5bb7388cdd)

node --input-type=module -e 'import { promptLinkAppPath } from "./packages/shared/src/promptLinks.ts"; console.log(promptLinkAppPath("https://app.t3.codes/new/?prompt=hi"), promptLinkAppPath("t3code://new/?prompt=hi"));'

Observed: null /new?prompt=hi. Expected: /new?prompt=hi /new?prompt=hi. To reproduce the app path, pass the hosted URL as an argument to the desktop executable. In the DesktopClerk second-instance fixture, the raw URL is absent from the links delivered to webLinks.receive on base, so the renderer never receives it.

Change

Accept exactly /new and /new/ on the configured hosted origin, preserving the query and returning the canonical /new route for both. The desktop launch handler can now enqueue the link, and DesktopWebLinkCoordinator can navigate to the existing draft route; the hosted landing uses the same parser, and custom-scheme handling is unchanged.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The focused shared regression failed on base with expected null to be '/new?prompt=hi' and passed on the patched checkout. The desktop ingress fixture also failed on base and passed after the fix. See the before/after runtime transcript and fixture instructions.
  • vp run check:changed exited 0, including format, lint, Knip, typecheck, and 13 affected tests. The hosted-mode browser scenario showed the same prompt on both checkouts; the hosted landing did not reproduce the desktop drop.
  • Not shown: Packaged Electron launch, OS protocol registration, and native mobile.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0ac304b and 609ffab.

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

promptLinkAppPath now recognizes hosted new-thread URLs ending in /new/ and maps them to /new. A test verifies that the prompt query is preserved.

Changes: Hosted new-thread links

Layer / File(s) Summary
Normalize hosted new-thread paths
packages/shared/src/promptLinks.ts, packages/shared/src/promptLinks.test.ts
The path mapper accepts /new and /new/. A test checks that a hosted /new/ URL maps to /new while retaining its prompt query.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 0ac30

Hosted new-thread links ending in a slash now open the draft route instead of being dropped. The change is small and tested, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: hosted /new/ prompt links with a trailing slash are now accepted. It follows the conventional commit form and matches the promptLinks.ts change and the new test. Scope…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem includes a reproduction command and expected behavior. The change explains the fix. Scope ci…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: hosted /new/ prompt links with a trailing slash are now accepted. It follows the conventional commit form and matches the promptLinks.ts change and the new test. Scope is shared, and the PR description confirms the desktop launch path is affected.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem includes a reproduction command and expected behavior. The change explains the fix. Scope cites the CONTRIBUTING.md bug-fix rule and explains why no issue is needed. Verification lists focused tests, a check run, and a gap: packaged Electron launch and OS protocol registration were not shown. It also names the model and harness. The description is complete enough to pass.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1b59ab3 and 0ac304b.

Files selected for processing: 2

  • packages/shared/src/promptLinks.test.ts
  • packages/shared/src/promptLinks.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0ac304b

Macroscope's review found this PR approvable — Hosted /new/ links now use the same prompt-link flow as /new links, preserving query parameters and existing origin restrictions. This is a narrow compatibility adjustment with no change to product defaults.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Linux Electron desktop, independently built from each commit, under Xvfb with fresh app/database and Chromium profiles, light theme, 1280×900 window. No projects or threads seeded; no model turn sent.

  1. Start the primary instance and wait for Welcome with Claude/Codex Ready.
  2. Launch a second instance with https://app.t3.codes/new/?prompt=hi; wait for it to exit and capture the primary after 12 seconds.
  3. Launch a second instance with the slashless control https://app.t3.codes/new?prompt=hi; capture after 12 seconds.
Before After
54e81819cb 609ffabd41
Trailing slash: stays on Welcome; no draft. Before: trailing-slash link leaves Welcome unchanged Trailing slash: opens a new draft containing “hi”. After: trailing-slash link opens the prompt draft
Slashless control opens “hi”. Before: slashless control opens a draft Slashless control opens another “hi” draft. After: slashless control opens a draft
Before recording After recording

Electron driver · Capture processing · Before action timeline · After action timeline

Stills were captured only after two screenshots 500 ms apart matched. Machine labels are covered by gray privacy masks; recordings have added action captions. Both second-instance processes exited with code 130 while the primary continued running.

Not shown:

  • Cold-launch URL argument handling and the reverse-order reproduction were not exercised; proof covers the reported second-instance flow from Welcome.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 91783c8 into pingdotgg:main Dec 2, 2026
36 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants