Skip to content

Add prompt deep links for new workspaces - #4189

Closed
panrafal wants to merge 1 commit into
getpaseo:mainfrom
panrafal:add-paseo-deeplink-hash-prompts
Closed

Add prompt deep links for new workspaces#4189
panrafal wants to merge 1 commit into
getpaseo:mainfrom
panrafal:add-paseo-deeplink-hash-prompts

Conversation

@panrafal

@panrafal panrafal commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Closes #

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Docs

Reasoning

New-workspace links could select a host, project, directory, and draft, but users still had to copy and paste the task they wanted to start.

This change adds a q query parameter that prefills the new workspace composer without submitting it. Both paseo://new?q=... and https://paseo.sh/new?q=... are supported, allowing users to review or edit the prepared prompt before starting their workspace.

Goals

  • Accept an encoded prompt through the /new q query parameter.
  • Support q in both paseo://new links and https://paseo.sh/new redirects.
  • Preserve the existing serverId, dir, name, projectId, and draftId parameters.
  • Prefill chat and terminal composers without automatically submitting the prompt.
  • Handle desktop cold starts and links opened while Paseo is already running.
  • Redact q from desktop launch-argument diagnostic logs.
  • Add automated coverage for app routing, website redirects, and desktop window routing.

Non-goals

  • Automatically submit the prompt or start an agent.
  • Support prompts in the URL fragment.
  • Guarantee prompt confidentiality from HTTP servers, proxies, browser history, or request logs; q is an ordinary query parameter.
  • Change the meaning of existing /new parameters.
  • Add universal-link association or an app-install fallback.
  • Change the new workspace screen’s visual design.
  • Change the app/daemon protocol.

QA

Requester verification:

  • Manually confirmed that the resulting deep link works end to end.

Focused unit tests:

npx vitest run \
  packages/app/src/navigation/new-workspace-route-params.test.ts \
  packages/desktop/src/new-workspace-navigation.test.ts \
  packages/desktop/src/window/desktop-window-owner.test.ts \
  packages/website/src/new-workspace-deep-link.test.ts \
  --bail=1

Test Files  4 passed (4)
Tests       15 passed (15)

Real-browser regression:

npm run test:e2e --workspace=@getpaseo/app -- \
  e2e/browser/new-workspace-deep-link.spec.ts

✓ a new-workspace deep link preserves query context and prefills its prompt
1 passed (31.9s)

The Playwright test:

  • Opens /new with serverId, name=TEst, and an encoded multiline q.
  • Confirms all query parameters remain intact and the URL has no fragment.
  • Confirms the message composer contains the decoded prompt.
  • Uses an isolated daemon on a temporary port; port 6767 is explicitly blocked by the fixture.
  • Stops both the isolated daemon and Metro after the test.

Website redirect verification:

GET /new?name=TEst&q=Just%20testing

HTTP/1.1 307 Temporary Redirect
location: paseo://new?name=TEst&q=Just%20testing

Additional checks:

npm run typecheck
Result: passed

npm run lint
Result: 0 warnings and 0 errors

npm run format
Result: passed

npm run format:check
Result: passed

npm run build --workspace=@getpaseo/website
Result: passed
Platform Tested Notes
iOS No Not manually tested
Android No Not manually tested
Web Yes Real Playwright composer flow and live website redirect tested
Desktop macOS Partial Deep-link parsing and window routing covered by automated tests
Desktop Windows Partial Deep-link parsing and window routing covered by automated tests
Desktop Linux Partial Deep-link parsing and window routing covered by automated tests

No visual layout changes are intended; the browser test verifies the changed composer behavior directly.

Checklist

  • One focused change
  • npm run typecheck passes
  • npm run lint passes
  • npm run format passes
  • QA evidence
  • Tests added or updated where it made sense

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T20:49:16.639534Z 2f3405b PR opened
🔒 Security Review Completed 2026-09-01T20:54:13.441096Z 2f3405b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds prompt-prefilling support to new-workspace deep links without automatically submitting the prompt.

  • Carries the q parameter through app, desktop, and website routing.
  • Seeds chat and terminal composers and clears drafts after successful terminal creation.
  • Redacts prompt values from desktop launch diagnostics.
  • Adds focused unit and browser coverage for the routing flow.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/app/src/screens/new-workspace-screen.tsx Seeds the composer after draft hydration and initializes terminal prompt text from the deep-link query.
packages/desktop/src/main.ts Routes new-workspace links during cold starts and subsequent desktop invocations while redacting prompt diagnostics.
packages/website/src/routes/new.tsx Registers the website endpoint that redirects new-workspace requests to the desktop app scheme.
packages/app/e2e/browser/new-workspace-deep-link.spec.ts Verifies the user-visible deep-link prefill behavior through a focused domain helper.

Reviews (10): Last reviewed commit: "Add prompt deep links for new workspaces" | Re-trigger Greptile

Comment thread packages/app/e2e/browser/new-workspace-deep-link.spec.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f3405bd56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/app/src/screens/new-workspace-screen.tsx
@capitally-dev
capitally-dev Bot force-pushed the add-paseo-deeplink-hash-prompts branch 7 times, most recently from 541142f to da2ea28 Compare September 4, 2026 22:27
@Laokashouji

Copy link
Copy Markdown

Plugin-initiated prefill: routing works, q is the missing piece

I'm building a plugin whose sidebar lists scheduled tasks from an internal platform. Each row should have a button that opens a new session prefilled with that task's config and recent run history, so the user can review and edit before sending.

I probed this against 0.7.2 from plugin surface code, three ways:

  1. Linking.openURL("paseo://new?q=...") — OS-level handoff, launches a new desktop window on the welcome screen, not connected to any daemon.
  2. Linking.openURL("paseo://app/new?serverId=<id>&q=...") — still a new window, but connected this time.
  3. history.pushState(null, "", "/new?serverId=<id>&q=...") plus a synthetic popstatenavigates in place, lands on the new-workspace screen. Composer is empty, as expected since this PR isn't merged.

So the in-app path already works; q is the only missing piece. Once this lands, a plugin can navigate to a prefilled composer without any new API.

Why plugins need it: paseo.agents.create({ prompt }) submits immediately, and attachments gets flattened into the first user message with externalResource dropped. There's currently no way to land text in a composer without starting a turn. #4306's addDraftAction rewrites an existing draft, which doesn't cover creating one from a sidebar.

Two questions:

  • Is pushState + popstate the sanctioned way for a plugin surface to navigate in-app, or is there an intended API? navigation currently exposes only openAgent and openWorkspace.
  • Would q be read on every mount of /new, or only on cold deep-link entry? In-app navigation needs the former.

Happy to test a build.

@capitally-dev
capitally-dev Bot force-pushed the add-paseo-deeplink-hash-prompts branch from da2ea28 to 95b31ff Compare September 7, 2026 17:17
@capitally-dev
capitally-dev Bot force-pushed the add-paseo-deeplink-hash-prompts branch from 95b31ff to 11c5a49 Compare September 7, 2026 18:00
@boudra

boudra commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closing this feature PR. Please describe the workflow and shared need in Discussions, as described in CONTRIBUTING.md.

@boudra boudra closed this Sep 8, 2026
@panrafal

panrafal commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@boudra why not have some discussion over implemented code instead of closing them outright, especially on PRs that add functionality broadly available in similar tools and expected. In discussions there are lots of requests without response so it gets buried - here at least we can talk over an implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants