Skip to content

Feature/saved prompt snippets#3062

Closed
sukar0972 wants to merge 14 commits into
pingdotgg:mainfrom
sukar0972:feature/saved-prompt-snippets
Closed

Feature/saved prompt snippets#3062
sukar0972 wants to merge 14 commits into
pingdotgg:mainfrom
sukar0972:feature/saved-prompt-snippets

Conversation

@sukar0972

@sukar0972 sukar0972 commented Jun 12, 2026

Copy link
Copy Markdown

What Changed

Added saved prompts support.

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Open in Devin Review

Note

High Risk
Deletes the entire desktop distribution and production release/deploy automation; shipping and install paths change materially until the new Linux workflow fully replaces them.

Overview
This PR removes the Electron desktop application (apps/desktop and related scripts, tests, and IPC/backend wiring) and drops the large release.yml pipeline that built signed desktop artifacts, published the CLI to npm, created GitHub releases, deployed hosted web to Vercel, and announced on Discord.

CI and release are narrowed: ci.yml no longer installs Electron, builds desktop, or verifies the preload bundle; a new linux-packages.yml workflow builds headless .deb / .rpm on v*.*.* tags (via vp run dist:linux) and uploads them to releases.

Product/docs positioning shifts from T3 Code to more Code (README, AGENTS, plans, devcontainer name) and de-emphasizes the desktop app in user-facing docs—README drops desktop install paths and points at headless Linux packages; issue templates remove apps/desktop and desktop-specific environment hints. CONTRIBUTING is shortened (less “we’re not taking PRs” / vouch wording).

Misc: .gitignore drops Electron build paths; adds ignored/.

Reviewed by Cursor Bugbot for commit b5d6cb5. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add saved prompt snippets to the composer and rebrand 'T3 Code' to 'more Code'

  • Introduces saved prompt snippets: new Snippet/SnippetMap contract types (snippets.ts), a /settings/snippets UI, and composer slash-command search that ranks results by trigger slug, title, and description
  • Renames all T3CODE_* environment variables to MORECODE_T3CODE_*, renames the t3 connect CLI subcommand to t3 cloud, and moves server HTTP endpoints from /api/connect/* to /api/cloud/*
  • Adds a section project kind with shared context markdown and credentials; section context is injected as a <task_section_context> block into the first user turn sent to providers
  • Adds a /runs route with RunsView listing agent runs with status filtering and the ability to interrupt active runs
  • Removes the Grok provider and claude-fable-5 model from built-in drivers; adds a semi-sandboxed runtime mode mapping to never approvals and workspace-write sandbox policy
  • Adds Linux Debian/RPM packaging scripts, a systemd unit, and related packaging infrastructure under packaging/linux/
  • Risk: all T3CODE_* environment variables, the t3 connect CLI, and /api/connect/* HTTP routes are renamed — existing server configurations, deployment scripts, and mobile build environments require updates
📊 Macroscope summarized b5d6cb5. 93 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

sukar0972 added 14 commits June 6, 2026 21:27
# Conflicts:
#	.env.example
#	.github/workflows/release.yml
#	apps/desktop/package.json
#	apps/desktop/src/electron/ElectronMenu.ts
#	apps/desktop/src/window/DesktopWindow.test.ts
#	apps/marketing/src/pages/download.astro
#	apps/marketing/src/pages/index.astro
#	apps/mobile/src/features/cloud/publicConfig.ts
#	apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
#	apps/web/index.html
#	apps/web/src/components/ChatView.tsx
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/chat/ChatHeader.tsx
#	apps/web/src/components/cloud/RelayClientInstallDialog.tsx
#	apps/web/src/components/settings/CloudSettings.tsx
#	apps/web/src/index.css
#	apps/web/src/main.tsx
#	docs/cloud/t3-code-connect-auth-flow.html
#	docs/operations/release.md
#	infra/relay/README.md
#	infra/relay/scripts/deploy.ts
#	pnpm-lock.yaml
#	scripts/lib/public-config.test.ts
#	scripts/lib/public-config.ts
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9ed3eed4-1f22-4fdb-a12f-b844f9376d1b

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sukar0972 sukar0972 closed this Jun 12, 2026
@sukar0972 sukar0972 deleted the feature/saved-prompt-snippets branch June 12, 2026 19:07
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jun 12, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b5d6cb5. Configure here.

body,
});
const nextMap: SnippetMap = { ...currentSnippets, [updated.id]: updated };
updateSettings({ promptSnippets: nextMap });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Edit ignores trigger changes

Medium Severity

In the edit-snippet dialog, the Trigger field stays editable, but saving only updates title, description, and body from the original snippet. A changed trigger is not applied, so the slash menu and stored id stay on the old value while the UI suggests the trigger was updated.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b5d6cb5. Configure here.

};
const nextSnippet = newSnippetFromDraft(draft);
const nextMap: SnippetMap = { ...currentSnippets, [nextSnippet.id]: nextSnippet };
updateSettings({ promptSnippets: nextMap });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Duplicate triggers overwrite snippets

Medium Severity

Adding a snippet does not check whether the trigger id already exists. Saving with a duplicate trigger replaces the existing entry in promptSnippets with no warning, which removes the prior snippet from settings and the slash menu.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b5d6cb5. Configure here.

query,
);
const rankedSnippets = searchSavedSnippetItems(savedSnippetItems, query);
return [...builtInAndProvider, ...rankedSnippets];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Provider commands beat snippets

Medium Severity

When filtering the slash menu with a query, built-in and provider slash commands are listed before saved snippets. Enter or Tab uses the first menu item, so a matching provider command can be applied instead of the saved snippet the user typed toward.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b5d6cb5. Configure here.

Comment on lines +88 to +99
} else if (!isValidSnippetId(id)) {
errors.push({
field: "id",
message:
"Trigger must start with a letter or digit and contain only lowercase letters, digits, and dashes.",
});
} else if (id.length > MAX_SNIPPET_ID_LENGTH) {
errors.push({
field: "id",
message: `Trigger must be ${MAX_SNIPPET_ID_LENGTH} characters or fewer.`,
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low settings/SnippetsSettings.logic.ts:88

The else if (id.length > MAX_SNIPPET_ID_LENGTH) branch on line 94 is unreachable because isValidSnippetId already returns false when the length exceeds MAX_SNIPPET_ID_LENGTH. An over-length ID therefore hits the pattern-error branch at line 88 and produces the misleading message about allowed characters instead of the intended length-specific message. Swap the two else if branches so the length check runs first.

Suggested change
} else if (!isValidSnippetId(id)) {
errors.push({
field: "id",
message:
"Trigger must start with a letter or digit and contain only lowercase letters, digits, and dashes.",
});
} else if (id.length > MAX_SNIPPET_ID_LENGTH) {
errors.push({
field: "id",
message: `Trigger must be ${MAX_SNIPPET_ID_LENGTH} characters or fewer.`,
});
}
} else if (id.length > MAX_SNIPPET_ID_LENGTH) {
errors.push({
field: "id",
message: `Trigger must be ${MAX_SNIPPET_ID_LENGTH} characters or fewer.`,
});
} else if (!isValidSnippetId(id)) {
errors.push({
field: "id",
message:
"Trigger must start with a letter or digit and contain only lowercase letters, digits, and dashes.",
});
}
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/settings/SnippetsSettings.logic.ts around lines 88-99:

The `else if (id.length > MAX_SNIPPET_ID_LENGTH)` branch on line 94 is unreachable because `isValidSnippetId` already returns `false` when the length exceeds `MAX_SNIPPET_ID_LENGTH`. An over-length ID therefore hits the pattern-error branch at line 88 and produces the misleading message about allowed characters instead of the intended length-specific message. Swap the two `else if` branches so the length check runs first.

Evidence trail:
apps/web/src/components/settings/SnippetsSettings.logic.ts lines 77-80 (isValidSnippetId checks length > MAX_SNIPPET_ID_LENGTH and returns false), lines 86-99 (validateSnippetDraft: line 88 checks !isValidSnippetId which catches over-length IDs before line 94's length check can run)

@@ -254,15 +253,11 @@ export const make = Effect.fn("effect-codex-app-server/CodexAppServerClient.make
export const layerChildProcess = (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 High src/client.ts:253

The layerChildProcess refactoring removed the forkScoped drain of handle.stderr. When the child process writes to stderr and the OS pipe buffer fills, the child blocks; the parent then deadlocks waiting for stdout output while the child waits for stderr buffer space. Consider restoring the Stream.runDrain(handle.stderr).pipe(Effect.ignore, Effect.forkScoped) call before constructing the client.

🤖 Copy this AI Prompt to have your agent fix this:
In file @packages/effect-codex-app-server/src/client.ts around line 253:

The `layerChildProcess` refactoring removed the `forkScoped` drain of `handle.stderr`. When the child process writes to stderr and the OS pipe buffer fills, the child blocks; the parent then deadlocks waiting for stdout output while the child waits for stderr buffer space. Consider restoring the `Stream.runDrain(handle.stderr).pipe(Effect.ignore, Effect.forkScoped)` call before constructing the client.

Evidence trail:
1. PR diff at `packages/effect-codex-app-server/src/client.ts`: git_diff MERGE_BASE..REVIEWED_COMMIT shows removal of `yield* Stream.runDrain(handle.stderr).pipe(Effect.ignore, Effect.forkScoped)` from `makeChildProcessClient` (which was deleted entirely).
2. New `layerChildProcess` at line 253-260 (REVIEWED_COMMIT) calls `makeChildStdio(handle)` and `make(...)` without any stderr drain.
3. `packages/effect-codex-app-server/src/_internal/stdio.ts` lines 13-22 (REVIEWED_COMMIT): `makeChildStdio` maps `stdin: handle.stdout`, `stdout: () => Sink.mapInput(handle.stdin, ...)`, `stderr: () => Sink.drain` — but `handle.stderr` is never referenced.
4. git_grep for `handle.stderr` in `packages/effect-codex-app-server/**` returns zero results at REVIEWED_COMMIT, confirming no code consumes the child process's stderr stream.

@@ -1129,49 +550,11 @@ function ChatMarkdown({
li({ node: _node, children, ...props }) {
return <li {...props}>{renderSkillInlineMarkdownChildren(children, skills)}</li>;
},
a({ node, href, children, ...props }) {
a({ node: _node, href, ...props }) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium components/ChatMarkdown.tsx:553

Same-document anchor links (e.g., #section) incorrectly receive target="_blank", causing them to open in a new tab instead of navigating within the document. The previous implementation checked href?.startsWith("#") to avoid adding target="_blank" to fragment links, but now all non-file links unconditionally get target="_blank" rel="noopener noreferrer". Consider restoring the fragment link check to preserve in-document navigation.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/ChatMarkdown.tsx around line 553:

Same-document anchor links (e.g., `#section`) incorrectly receive `target="_blank"`, causing them to open in a new tab instead of navigating within the document. The previous implementation checked `href?.startsWith("#")` to avoid adding `target="_blank"` to fragment links, but now all non-file links unconditionally get `target="_blank" rel="noopener noreferrer"`. Consider restoring the fragment link check to preserve in-document navigation.

Evidence trail:
apps/web/src/components/ChatMarkdown.tsx line 553-557 at REVIEWED_COMMIT: unconditional `target="_blank"` for all non-file links. Old code (visible in diff at MERGE_BASE): `const isSameDocumentLink = href?.startsWith("#") ?? false;` with conditional target/rel, plus `handleMarkdownFragmentClick` handler. git_diff base=MERGE_BASE head=REVIEWED_COMMIT path=apps/web/src/components/ChatMarkdown.tsx shows removal of fragment-link check and associated functions (findMarkdownFragmentTarget, decodeMarkdownFragmentId, normalizeSanitizedFragmentId, handleMarkdownFragmentClick).

@macroscopeapp

macroscopeapp Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

2 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

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

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant