From f22a496ab9e010a3f8dad217688f5103c6aa63af Mon Sep 17 00:00:00 2001 From: Chen Cui Date: Fri, 27 Nov 2026 09:45:19 +0800 Subject: [PATCH 1/5] Support Codex Ultrafast speed Use the speeds reported by Codex and remember the selected service tier per model. Preserve Fast preferences and keep saved tasks usable when the catalog changes. Modern Web Guidance: forms and accessibility for labeled native radio groups and keyboard support, browser-ui-theming for native control styling. --- CHANGELOG.md | 1 + docs/guide.md | 6 +-- i18n/state/errors.de.json | 5 --- i18n/state/errors.es.json | 5 --- i18n/state/errors.fr.json | 5 --- i18n/state/errors.it.json | 5 --- i18n/state/errors.ja.json | 5 --- i18n/state/errors.ko.json | 5 --- i18n/state/errors.pt.json | 5 --- i18n/state/errors.sv.json | 5 --- i18n/state/errors.zh-CN.json | 5 --- i18n/state/errors.zh-Hant.json | 5 --- scripts/check-git-workspace.mjs | 2 +- scripts/check-task-agent-switch.mjs | 2 +- scripts/check-task-model.mjs | 31 +++++++++------ scripts/check-task-permissions.mjs | 2 +- scripts/check-ui.mjs | 2 +- src/server/workspace.ts | 37 ++++++++++------- src/shared.ts | 6 ++- src/web/agent-picker.tsx | 37 ++++++++++++----- src/web/agent-preferences.ts | 10 ++++- src/web/citation-check.tsx | 2 +- src/web/commit-agent-settings.tsx | 9 ++--- src/web/locales/de.json | 3 ++ src/web/locales/errors/de.json | 2 +- src/web/locales/errors/es.json | 2 +- src/web/locales/errors/fr.json | 2 +- src/web/locales/errors/it.json | 2 +- src/web/locales/errors/ja.json | 2 +- src/web/locales/errors/ko.json | 2 +- src/web/locales/errors/pt.json | 2 +- src/web/locales/errors/sv.json | 2 +- src/web/locales/errors/zh-CN.json | 2 +- src/web/locales/errors/zh-Hant.json | 2 +- src/web/locales/es.json | 3 ++ src/web/locales/fr.json | 3 ++ src/web/locales/it.json | 3 ++ src/web/locales/ja.json | 3 ++ src/web/locales/ko.json | 3 ++ src/web/locales/pt.json | 3 ++ src/web/locales/sv.json | 3 ++ src/web/locales/zh-Hant.json | 3 ++ src/web/main.tsx | 10 ++--- src/web/playground/data.ts | 4 +- src/web/playground/models.ts | 2 +- src/web/style.css | 8 ++++ src/web/task-model-picker.tsx | 18 +++++---- src/web/zh-CN.ts | 2 +- tests/agent-preferences.test.ts | 19 ++++----- tests/playground.test.ts | 2 +- tests/workspace.test.ts | 62 +++++++++++++++++++---------- 51 files changed, 211 insertions(+), 160 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe45a89f..64015bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Notable changes to Papilot, newest first. The format follows [Keep a Changelog]( ### Added +- Choose **Ultrafast** in the Codex model picker when your account and model offer it. Papilot remembers the selected speed per model. - Choose **ZCode** for manuscript tasks. Papilot uses your local ZCode CLI and its default model, streams replies and tool activity, and resumes the same conversation on follow-up turns. ([#338](https://github.com/PapilotAI/papilot/issues/338)) - Use a third-party OpenAI-compatible Chat Completions API with **Settings → Runtime → Agents → Papilot Writer → Custom API**. Save the provider's base URL, model ID and API key, then choose that model for a task. ([#338](https://github.com/PapilotAI/papilot/issues/338)) - Set the LaTeX source editor's font size on its own with **Editor font size** in **Settings → Appearance** (10–24 px). The PDF and the rest of the interface keep their size, and the choice is remembered in this browser. ([#345](https://github.com/PapilotAI/papilot/issues/345)) diff --git a/docs/guide.md b/docs/guide.md index c7972cc6..4cf2dfe8 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -74,7 +74,7 @@ To use a third-party OpenAI-compatible model, open **Settings → Runtime → Ag The model menu below the chat lists models from every configured agent. Choosing another model from the current agent applies it to the next turn. Choosing a model from another agent moves the task to that agent: the conversation, proposed changes, review decisions and unsent drafts stay in the task. The next turn starts a session of the new agent, and Papilot gives it the conversation so far: each request and the replies to it, oldest first. Tool activity is left out, because the task's files already contain the earlier edits. If the task is working, its turn stops first. Instructions already queued behind that turn go to the new agent; your unsent draft stays in the composer. Tasks that Papilot 0.13 and earlier restarted on another agent still link to the task they replaced. -Each task runs on one agent and model, chosen from the model menu below the prompt. The menu lists every available agent's models, grouped by agent with your recent choices first; type to search all of them, or use the arrow keys and Enter. Reasoning effort and fast mode for the chosen model sit below the list. Use the arrow keys on a focused reasoning slider to change its level. Papilot remembers the agent, and each agent's model and reasoning effort, for the next task. Papilot looks for every agent when it starts and whenever you select **Reconnect**, and offers only the ones it finds on this host: an installed CLI, or the API key an SDK-based agent needs. The `papilot` command always offers Codex, because it installs it; the desktop app offers it when it finds one. An agent that is found but not signed in is listed as unavailable and says why. **Settings → Runtime → Agents** shows every supported agent and its live availability, including agents that are not set up. Select an agent card to see its account, model names, setup instructions, installation checks, and usage limits when the agent reports them. Model names appear as compact labels, with longer catalogs expandable. When setup is not detected, the card explains the server-side detection result, offers steps for that adapter, and provides Reconnect to refresh availability. Changes to environment variables require restarting Papilot; a different terminal or desktop-app login may not configure the running server. Details open within Settings; quotas are hidden while the connection is unavailable. The **LaTeX** page automatically identifies the active distribution (such as MacTeX, TeX Live, or MiKTeX), version, and installation location on the host. +Each task runs on one agent and model, chosen from the model menu below the prompt. The menu lists every available agent's models, grouped by agent with your recent choices first; type to search all of them, or use the arrow keys and Enter. Reasoning effort and speed settings for the chosen model sit below the list. When your Codex account and model offer Ultrafast, choose it under **Speed**. Models that only offer Fast have a **Fast mode** switch. Use the arrow keys on a focused reasoning slider to change its level. Papilot remembers the agent, and each agent's model and reasoning effort, for the next task. Papilot looks for every agent when it starts and whenever you select **Reconnect**, and offers only the ones it finds on this host: an installed CLI, or the API key an SDK-based agent needs. The `papilot` command always offers Codex, because it installs it; the desktop app offers it when it finds one. An agent that is found but not signed in is listed as unavailable and says why. **Settings → Runtime → Agents** shows every supported agent and its live availability, including agents that are not set up. Select an agent card to see its account, model names, setup instructions, installation checks, and usage limits when the agent reports them. Model names appear as compact labels, with longer catalogs expandable. When setup is not detected, the card explains the server-side detection result, offers steps for that adapter, and provides Reconnect to refresh availability. Changes to environment variables require restarting Papilot; a different terminal or desktop-app login may not configure the running server. Details open within Settings; quotas are hidden while the connection is unavailable. The **LaTeX** page automatically identifies the active distribution (such as MacTeX, TeX Live, or MiKTeX), version, and installation location on the host. **Settings → General → Quick model** chooses the model for quick background jobs: checking citations in the Library and naming tasks. **Automatic** lets each job use the small model of the agent it would use anyway, such as a task's own agent for its title. A model you choose, such as DeepSeek V4.1 Flash UltraFast from DeepSeek Harness, does all of them; it is saved on the Papilot host, where the jobs run, and while its agent is signed out or off the jobs fall back to **Automatic**. @@ -126,7 +126,7 @@ Qoder 1.1.91 and CodeBuddy 2.185.0 were checked with authenticated session disco - **ZCode** runs [ZCode CLI](https://github.com/zai-org/ZCode/blob/v4.0.0/apps/zcode-cli/docs/usage/01-quickstart.md) 0.18.0 or newer with the default model configured in ZCode. Install it on the Papilot host, run `zcode login` or [configure a provider](https://github.com/zai-org/ZCode/blob/v4.0.0/apps/zcode-cli/docs/usage/03-config.md), then select **Reconnect** under **Settings → Runtime → Agents**. On macOS, Papilot can also find the CLI bundled in `ZCode.app` in `/Applications` or `~/Applications`. To choose a specific executable or `zcode.cjs` bundle, set `PAPILOT_ZCODE_BIN` before starting Papilot. Settings shows **Sign-in not checked** after `zcode doctor` confirms the installation. Login and provider failures can show up when you send the first task. If you have no saved agent preference, Papilot selects an agent with a checked sign-in when one is available. Replies and tool activity stream, supported models can read image attachments, and each task resumes its own session. **Accept edits** uses ZCode’s edit mode, which can approve file edits outside the task worktree. ZCode declines operations that require interactive approval. **YOLO** skips ordinary approval prompts under ZCode’s native rules. ZCode runs tools on the host with its own permissions. Read-only tasks such as AI review, citation checks, compilation diagnosis and commit-message generation require a compatible agent. For standalone helper turns, Papilot removes the temporary ZCode session database and diagnostic logs when the CLI exits. ZCode may keep model I/O logs and tool artifacts in its configured storage directory. On Windows, point Papilot to the CLI executable or `zcode.cjs` so it can pass multiline instructions. The CLI takes the task prompt as a command-line argument, so the host’s argument length limit applies. -Reasoning effort and Fast mode are remembered separately for each agent/model in this browser or desktop app. Switching away and back, including after a reload, restores that model’s supported settings. **Model default** is remembered as an explicit choice. Successfully saved changes in an existing task also become the remembered choice for future model selections; other existing tasks keep their current settings. Switching an existing task to another agent uses the destination model’s remembered effort and Fast mode. +Reasoning effort and speed are remembered separately for each agent/model in this browser or desktop app. Switching away and back, including after a reload, restores that model’s supported settings. **Model default** is remembered as an explicit choice. Successfully saved changes in an existing task also become the remembered choice for future model selections; other existing tasks keep their current settings. Switching an existing task to another agent uses the destination model’s remembered effort and speed. ## Task permissions @@ -212,7 +212,7 @@ Select **PDF** under the paper in the sidebar to read the manuscript as it is on - Type a page number or use the arrows to change page. Zoom with **−** and **+**, the zoom menu (**Fit width**, **Fit page** or a percentage), ⌘ or Ctrl + scroll, a trackpad pinch or a two-finger pinch on a phone. ⌘+ / ⌘− / ⌘0 (Ctrl on Windows and Linux) zoom the whole interface, not just the PDF. The zoom is remembered. - ⌘F (Ctrl+F) or the search button finds text in every page; Enter and Shift+Enter step through the matches. -Choose **Version Management** (the clock with a rewind arrow) below **Manuscript** in the sidebar. This opens a dedicated workspace with commit and sync controls pinned on the left, a separately scrolling file list, and a file diff or **Version history** on the right. The sidebar shows the changed-file count. The workspace remembers the selected file, history view and commit draft, while Manuscript keeps its PDF position and panel preference. File rows show names, muted folder paths and status indicators. Hover over a status indicator for its meaning and available added/removed line counts. Select a file to read its diff in the main workspace; the file list stays compact. The diff has original/current line numbers and previous/next change navigation, and long diffs scroll independently. Return to Manuscript to continue at the same PDF position. On a phone, the controls and file list stack above the detail area; return to the file list to choose another file. The single main button changes from **Commit** to **Sync** when the chosen changes are committed and incoming or outgoing commits remain, then to **Synced** when both sides match. Incoming commits are checked automatically while the Git panel is visible. **Sync** fetches remote history, integrates incoming commits and pushes local commits; it keeps uncommitted edits, and stops if local changes prevent the merge or conflicts need attention. The dropdown stays available in every state: **Commit and sync** commits first, then syncs, and **Sync** can check the remote even when the main button reads **Synced**. A failed sync keeps the local commit so you can retry **Sync**. **Version history** is visible by default below the changed files. Each entry shows the commit message, author and date; expand it to read the full message and open its changed files in the main diff view. **Older versions** loads earlier entries. **Restore this version** asks for confirmation and creates a new local version with the selected content, preserving the entire history. Save pending changes first; restoration refuses a stale version, ongoing Git operations and ignored-file collisions. Sync remains a separate choice in the same main button. Advanced features are off by default: enable **Settings → Git → Show advanced Git features** in the App's existing settings to show the commit graph, worktrees, amend and separate remote actions. This preference is saved in the browser. Staging is available in the default view. Clicking a file in **Staged changes** shows the version to commit; clicking it in **Changes** shows only the edits not staged yet. If the remote also changed the file, its indicator shows both statuses (for example **↓M, M**); the tooltip explains incoming and local changes. Hover over a file for its actions: **+** stages it, **−** unstages it, and the undo arrow discards its unstaged changes after asking (staged changes stay, and an untracked file is deleted). The same actions for a whole list sit on its header. Press Enter or **Commit** to commit what is staged, or, with nothing staged, every changed file but build output as it is on disk; with advanced Git enabled, the arrow beside **Commit** also offers **Commit (Amend)** and **Commit and push**. New build output (LaTeX's `.aux`, `.log`, `.synctex.gz` and the like, minted's `_minted*` cache, and macOS's `.DS_Store`) is left out of such a commit, and the **⋯** menu in the Changes header offers **Add to .gitignore**: one click adds a pattern for each kind of file (such as `*.aux`) to the repository's `.gitignore`, without repeating patterns it already has, and `.gitignore` then appears as a change to commit. The commit graph draws the history with its branches, remote branches and tags, HEAD as an open circle, and each task's branch as the task; its header names the branch and how far it is ahead of or behind its upstream. The ✨ button in the message box writes the commit message, like Cursor's: the current conversation's agent reads the chosen files' changes, the titles of the tasks that changed them and the repository's recent commit subjects, whose style and language it follows, and answers in one read-only turn using the selected model and reasoning effort. No file is changed, and Codex does not keep the turn in its history. Edit the message before committing if you like. **Settings → Git → Commit-message agent** defaults to **Follow current conversation**: Git remembers the last conversation visited in the same paper, including after a reload, and uses the new-task agent when no conversation has been visited. The same model picker used in conversations lets you choose the agent, model, reasoning effort and, where supported, Fast mode. Choosing a model or changing its settings turns off **Follow current conversation** and saves the complete choice across conversations and reloads. Turn the switch back on to follow the conversation’s model settings again. This browser preference also applies to commit-message generation within tasks; it does not change new tasks or merge-conflict resolution. If the selected agent is unavailable or cannot run read-only tasks, generation reports the problem without switching agents or clearing your draft. When the repository has a remote, the commit graph's header offers **Fetch** to check for new commits, **Pull** to fast-forward, and **Push** to send your commits, or **Publish branch** for a branch that has no upstream yet. When your branch and its upstream have both moved on, for example after a coauthor pushed from Overleaf, **Merge** takes Pull's place and merges the upstream into your branch (it never rebases). A merge without conflicts commits itself. One with conflicts stops, and the panel shows how many files still have conflict markers (marked **!**): **Resolve with** the agent chosen on the new-task page edits only those files in the manuscript checkout, keeping both sides' changes where they fit and saying where it had to choose, and its summary appears in the panel. Read each file's diff, then **Commit merge**, or **Abort merge** to return to where you were. Until the merge is committed or aborted, accepting, rejecting and undoing review changes, other commits, pull and push are refused with a message saying so. Remote operations use the host's own Git credentials and never prompt; if a credential is missing they fail with Git's message. The PDF recompiles when the working tree changes and reopens at the same page and zoom; **Recompile** retries a failed build and **Open the PDF file** opens the PDF itself. A temporary Git index captures the working tree, so your index, branches and files are not touched. Builds reuse the review engine's cache in the repository's `.git/papilot` folder. On phones, switch between **PDF**, **Notes** and **Git** in the header. +Choose **Version Management** (the clock with a rewind arrow) below **Manuscript** in the sidebar. This opens a dedicated workspace with commit and sync controls pinned on the left, a separately scrolling file list, and a file diff or **Version history** on the right. The sidebar shows the changed-file count. The workspace remembers the selected file, history view and commit draft, while Manuscript keeps its PDF position and panel preference. File rows show names, muted folder paths and status indicators. Hover over a status indicator for its meaning and available added/removed line counts. Select a file to read its diff in the main workspace; the file list stays compact. The diff has original/current line numbers and previous/next change navigation, and long diffs scroll independently. Return to Manuscript to continue at the same PDF position. On a phone, the controls and file list stack above the detail area; return to the file list to choose another file. The single main button changes from **Commit** to **Sync** when the chosen changes are committed and incoming or outgoing commits remain, then to **Synced** when both sides match. Incoming commits are checked automatically while the Git panel is visible. **Sync** fetches remote history, integrates incoming commits and pushes local commits; it keeps uncommitted edits, and stops if local changes prevent the merge or conflicts need attention. The dropdown stays available in every state: **Commit and sync** commits first, then syncs, and **Sync** can check the remote even when the main button reads **Synced**. A failed sync keeps the local commit so you can retry **Sync**. **Version history** is visible by default below the changed files. Each entry shows the commit message, author and date; expand it to read the full message and open its changed files in the main diff view. **Older versions** loads earlier entries. **Restore this version** asks for confirmation and creates a new local version with the selected content, preserving the entire history. Save pending changes first; restoration refuses a stale version, ongoing Git operations and ignored-file collisions. Sync remains a separate choice in the same main button. Advanced features are off by default: enable **Settings → Git → Show advanced Git features** in the App's existing settings to show the commit graph, worktrees, amend and separate remote actions. This preference is saved in the browser. Staging is available in the default view. Clicking a file in **Staged changes** shows the version to commit; clicking it in **Changes** shows only the edits not staged yet. If the remote also changed the file, its indicator shows both statuses (for example **↓M, M**); the tooltip explains incoming and local changes. Hover over a file for its actions: **+** stages it, **−** unstages it, and the undo arrow discards its unstaged changes after asking (staged changes stay, and an untracked file is deleted). The same actions for a whole list sit on its header. Press Enter or **Commit** to commit what is staged, or, with nothing staged, every changed file but build output as it is on disk; with advanced Git enabled, the arrow beside **Commit** also offers **Commit (Amend)** and **Commit and push**. New build output (LaTeX's `.aux`, `.log`, `.synctex.gz` and the like, minted's `_minted*` cache, and macOS's `.DS_Store`) is left out of such a commit, and the **⋯** menu in the Changes header offers **Add to .gitignore**: one click adds a pattern for each kind of file (such as `*.aux`) to the repository's `.gitignore`, without repeating patterns it already has, and `.gitignore` then appears as a change to commit. The commit graph draws the history with its branches, remote branches and tags, HEAD as an open circle, and each task's branch as the task; its header names the branch and how far it is ahead of or behind its upstream. The ✨ button in the message box writes the commit message, like Cursor's: the current conversation's agent reads the chosen files' changes, the titles of the tasks that changed them and the repository's recent commit subjects, whose style and language it follows, and answers in one read-only turn using the selected model and reasoning effort. No file is changed, and Codex does not keep the turn in its history. Edit the message before committing if you like. **Settings → Git → Commit-message agent** defaults to **Follow current conversation**: Git remembers the last conversation visited in the same paper, including after a reload, and uses the new-task agent when no conversation has been visited. The same model picker used in conversations lets you choose the agent, model, reasoning effort and, where supported, speed. Choosing a model or changing its settings turns off **Follow current conversation** and saves the complete choice across conversations and reloads. Turn the switch back on to follow the conversation’s model settings again. This browser preference also applies to commit-message generation within tasks; it does not change new tasks or merge-conflict resolution. If the selected agent is unavailable or cannot run read-only tasks, generation reports the problem without switching agents or clearing your draft. When the repository has a remote, the commit graph's header offers **Fetch** to check for new commits, **Pull** to fast-forward, and **Push** to send your commits, or **Publish branch** for a branch that has no upstream yet. When your branch and its upstream have both moved on, for example after a coauthor pushed from Overleaf, **Merge** takes Pull's place and merges the upstream into your branch (it never rebases). A merge without conflicts commits itself. One with conflicts stops, and the panel shows how many files still have conflict markers (marked **!**): **Resolve with** the agent chosen on the new-task page edits only those files in the manuscript checkout, keeping both sides' changes where they fit and saying where it had to choose, and its summary appears in the panel. Read each file's diff, then **Commit merge**, or **Abort merge** to return to where you were. Until the merge is committed or aborted, accepting, rejecting and undoing review changes, other commits, pull and push are refused with a message saying so. Remote operations use the host's own Git credentials and never prompt; if a credential is missing they fail with Git's message. The PDF recompiles when the working tree changes and reopens at the same page and zoom; **Recompile** retries a failed build and **Open the PDF file** opens the PDF itself. A temporary Git index captures the working tree, so your index, branches and files are not touched. Builds reuse the review engine's cache in the repository's `.git/papilot` folder. On phones, switch between **PDF**, **Notes** and **Git** in the header. ![Version Management workspace](assets/version-management.png) diff --git a/i18n/state/errors.de.json b/i18n/state/errors.de.json index 6af1dff7..8aaa51f4 100644 --- a/i18n/state/errors.de.json +++ b/i18n/state/errors.de.json @@ -524,11 +524,6 @@ "textHash": "847a9adcd8ed9f830dad3a6aeaddc3a41ac51540615c196603744329f5d5a8b4", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "9b5ebf65e6df90fb9e0a6cc2eafea70e6117f4898baf4c6b007d4b8b85417252", - "textHash": "7530a4ebe32a6c7b8cbda49b022f2d436766ec909b804b6091e7b3764d7a7501", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "4f4cde8044e87e63dddc69e733548bc518eeff2c115ca149930ea5ca67e929ae", "textHash": "6e217f11b036258f8a6449ea9adf436c2b4da919721f8d60b7caa14243a0d3f3", diff --git a/i18n/state/errors.es.json b/i18n/state/errors.es.json index 4ff00bfd..5a05acf9 100644 --- a/i18n/state/errors.es.json +++ b/i18n/state/errors.es.json @@ -524,11 +524,6 @@ "textHash": "599b43e809addcb6709b5665ebe3f52ea3970e90ccd6e7bca8b1a39be16f97fb", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "f918fb841d540f6c66370b1ac503c7da71c8de608c13ebb55533f18c519e7875", - "textHash": "c3d5f2fc60523cdca00ae91eddb767d61f8f4e828071983e23f2604bcc1bec5b", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "ad26b2dce38d13b0acf809fde36e24d08bd0088339757dc4ac07aefe0ea1e196", "textHash": "4144c55524b9db0b0d13661ee8637034733c8364d6770c550d18d85ad19aaa88", diff --git a/i18n/state/errors.fr.json b/i18n/state/errors.fr.json index 339f197d..adb5f9ae 100644 --- a/i18n/state/errors.fr.json +++ b/i18n/state/errors.fr.json @@ -524,11 +524,6 @@ "textHash": "96292d1b5e3faf745879a7ee7bb951f168b7e44baf6bcc259c272471d6749ef4", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "15f8dbc1f15852183192a34f773a3520f06b398a1d84c0094af073ff62e11441", - "textHash": "978cba4ca2ad757859a3eb9d326474bbfc6ca80440abb4beb5529e3bf5e4b8e1", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "bf9bd390db83ada327bc52c2e50d61d03fb33eb093b9b7c57ed386ace9bcb743", "textHash": "ecdb47f556599b4d1e39955f698f861810b82cf93ac437b2e9d3495b2ff43628", diff --git a/i18n/state/errors.it.json b/i18n/state/errors.it.json index 0f8938ca..c0d6efde 100644 --- a/i18n/state/errors.it.json +++ b/i18n/state/errors.it.json @@ -524,11 +524,6 @@ "textHash": "c9a9488f6ed3e7c2fc7a77d296853df80ca6aa059578a7f2849eadc64d8a7994", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "6a9b57c2cb4f5ed786f712cbc9b6a4efbabf3db8f22db49e7ba1556f4ff1a7e2", - "textHash": "9d05705d2ca5c0b846a511b81e11a638e054e08e0a31e5708a4d8404872fb1ad", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "855eed4d595a543d01715b2c10d81005e17fb02b8f26a6c4db6603fd5655852e", "textHash": "2db7e96a97cf9197344d2b20bfbff167a175f5d5b6fb389e223c15800b304c61", diff --git a/i18n/state/errors.ja.json b/i18n/state/errors.ja.json index 03f56773..f5103db3 100644 --- a/i18n/state/errors.ja.json +++ b/i18n/state/errors.ja.json @@ -524,11 +524,6 @@ "textHash": "e148572d23928034bd7236a0cb5949b0075d418e61dcdff3d5a61004ad7505cc", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "9bca9152151df757b0bd8dc063cebceed103ae1ba3e635278e6a970a232ea431", - "textHash": "7fcb94735eb3113c84baed58ad0bb97728a5f0d7ce3ed9e5fd44718ed72f9bf4", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "5c07cba3d6241b7ac4aadd1710c81093863c11a4dba61649594b6e1379249c9f", "textHash": "a9c9b4aeca850d2d71e702b7ec9aabe2b5f7fbea9a7d8b12e9652ca3886e07be", diff --git a/i18n/state/errors.ko.json b/i18n/state/errors.ko.json index bda8f692..c7fedfc3 100644 --- a/i18n/state/errors.ko.json +++ b/i18n/state/errors.ko.json @@ -524,11 +524,6 @@ "textHash": "39a8ccad4411b36f8de7cd901b75913d152e8d01d34200efe38d3593e4ae4359", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "49d028f062e46d1b89999317b54a4e6e4f378a608e8f5a9894ef7ab12a4ef052", - "textHash": "bcca76539536f24de9cfb7ad088732f7cdd11d0d419ce0391ffc2790e5da66ba", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "5ab8061c9ca3b8af2217e11c3fc3bf86f877232b4d1f7e69e5b552401cd98a4c", "textHash": "a7e0992b6461667900bb0448f2f29f3f31c615676946322ef136167a9a5fc7a8", diff --git a/i18n/state/errors.pt.json b/i18n/state/errors.pt.json index 94fbd01d..e1de9eb8 100644 --- a/i18n/state/errors.pt.json +++ b/i18n/state/errors.pt.json @@ -524,11 +524,6 @@ "textHash": "70e9072fc446c6507b13850a7621f47b3d4b3ae34e81cda0174e0ef5f33cb762", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "06830d8c6c7fb6d6f5553b4fcd7bb6d17ab5b0de17a425f51e77b1a78d58d16f", - "textHash": "60881d7e67c4ef58311fbb376605fe9c7626d83bfdb40fd7cbeaedad3dd5e900", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "67a38908a7d18df66280e600f165a675d5de261cb722a1258203b6fbe9643487", "textHash": "a652f53866a996174c722153f46ea3d79679fde35a15d57ecbcc14d5cb012c3b", diff --git a/i18n/state/errors.sv.json b/i18n/state/errors.sv.json index 0b2563f0..f8eddf78 100644 --- a/i18n/state/errors.sv.json +++ b/i18n/state/errors.sv.json @@ -524,11 +524,6 @@ "textHash": "b0bd1b166b3585e5fd97f1e4385be25583557361e13bb018d1c72756a198742a", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "b293c4976ba0a316398586906ddf7f33c97abd59e2f7fb1ff3157e9f30e565ba", - "textHash": "acf0edb881046b7b590afddf2759d58d59b88fa3f97947926a8f87793573a0ab", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "79aa9fb364fab3591081e3b33b0670549fdee61b54e40a8b1d181186fe4cdbd3", "textHash": "94ea5a01684f3fedc758a62ee99ad742918c853b1bea3f37992a8ce0fdcffd4d", diff --git a/i18n/state/errors.zh-CN.json b/i18n/state/errors.zh-CN.json index 62431384..c1c68fe4 100644 --- a/i18n/state/errors.zh-CN.json +++ b/i18n/state/errors.zh-CN.json @@ -524,11 +524,6 @@ "textHash": "fe1518dd151b1c163ec5939c188e5ca41e6de9e42e64f64bbab6aace57a9e6b1", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "aae9b762cf78c2c3a3461f9b2f5817c1d5e0117e63e98448a39fbfc107e05d40", - "textHash": "1e6fa2b0c73cff75f8de6f78590a0edebf6f32b3c3180bfcc4444357aec53cf7", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "2a8ae8b1d3d16b3f28a1a70f93c04e54e3d87e1f356a9f9998f2c7cb9e9116b0", "textHash": "0a32f2992256923b664f00f9a7397afa98326558a47731daa8a1bafd6a9df400", diff --git a/i18n/state/errors.zh-Hant.json b/i18n/state/errors.zh-Hant.json index a4742c29..ae6f702e 100644 --- a/i18n/state/errors.zh-Hant.json +++ b/i18n/state/errors.zh-Hant.json @@ -524,11 +524,6 @@ "textHash": "28d65aa9f03f5d33d46302242b29c3750815b7ce91896844de674e28bc8bce68", "model": "codex" }, - "Fast mode is not available for this model.": { - "revision": "9d65d1d519d4d7c485ee82e1aa74018c3ff722386e4a24b510f68c8b09b3909d", - "textHash": "d9853f57a67ee4129d11e0232d35b656f3dde7b69b48fb8bbd84cd092564d227", - "model": "gemini-4-argon-medium" - }, "Files must be 25 MB or smaller.": { "revision": "953d149617c3de239a2a18a010a76ffba10af336add7a3e0efebe9c08ac0c29f", "textHash": "1d1a86ffb358f3c3018ce0aab9bbda82467112ac0ad62f959ef446d517a2f941", diff --git a/scripts/check-git-workspace.mjs b/scripts/check-git-workspace.mjs index da8ded93..d73ca658 100644 --- a/scripts/check-git-workspace.mjs +++ b/scripts/check-git-workspace.mjs @@ -23,7 +23,7 @@ page.on('requestfailed', request => { }); const project = { id: 'git-paper', name: 'Example paper', path: '/tmp/git-paper', createdAt: 1 }; const task = { id: 'git-task', projectId: project.id, title: 'Clarify the introduction', name: 'git-task', instructions: '', agent: 'claude', model: 'model', effort: 'high', status: 'idle', createdAt: 1, updatedAt: 1, review: null }; -const runtime = { connected: true, authenticated: true, models: [{ id: 'model', name: 'Model', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'low', fastMode: { serviceTier: 'priority', description: '' } }, { id: 'other-model', name: 'Other model', isDefault: false, efforts: ['low', 'high'], defaultEffort: 'high' }] }; +const runtime = { connected: true, authenticated: true, models: [{ id: 'model', name: 'Model', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'low', serviceTiers: ['priority'] }, { id: 'other-model', name: 'Other model', isDefault: false, efforts: ['low', 'high'], defaultEffort: 'high' }] }; const snapshot = { version: 'test', csrf: 'fixture', projects: [project], tasks: [task], requests: [], runtime, runtimes: { codex: runtime, claude: { ...runtime } }, gitAvailable: true }; const initialFiles = [{ path: 'main.tex', status: 'M', staged: false, unstaged: true, lines: [2, 4] }, { path: 'references.bib', status: '?', staged: false, unstaged: true }]; const git = { branch: 'main', remote: true, upstream: 'origin/main', ahead: 1, behind: 0, head: { hash: 'abc1234', subject: 'Clarify the introduction', date: 1 }, files: structuredClone(initialFiles) }; diff --git a/scripts/check-task-agent-switch.mjs b/scripts/check-task-agent-switch.mjs index 9f53c1a5..b228da79 100644 --- a/scripts/check-task-agent-switch.mjs +++ b/scripts/check-task-agent-switch.mjs @@ -19,7 +19,7 @@ page.on('pageerror', error => errors.push(error.message)); const task = { id: 'fixture-task', projectId: 'paper', agent: 'codex', name: 'p-task', title: 'Revise the introduction', instructions: 'Keep the meaning.', worktree: '/tmp/paper', threadId: 'thread', turnId: 'turn', model: null, effort: null, status: 'running', createdAt: 1, updatedAt: 1, feedbackCursor: 0, error: null, review: null }; const runtime = { connected: true, authenticated: true, account: null, error: null, models: [ { id: 'fast-model', name: 'Fast model', isDefault: true, efforts: ['low', 'medium', 'high'], defaultEffort: 'medium' }, - { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: 'Faster responses' } }, + { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', serviceTiers: ['priority'] }, ] }; runtime.permissionOptions = [{ value: 'workspace', label: 'Workspace access', detail: 'Native approvals' }, { value: 'full', label: 'Full access', detail: 'Approve all tools' }]; const zcode = { ...runtime, models: [], authenticationUnchecked: true, supportsReadOnlyTasks: false }; diff --git a/scripts/check-task-model.mjs b/scripts/check-task-model.mjs index 5e531ca9..fd4f90c9 100644 --- a/scripts/check-task-model.mjs +++ b/scripts/check-task-model.mjs @@ -18,7 +18,7 @@ page.on('pageerror', error => errors.push(error.message)); const task = { id: 'fixture-task', projectId: 'paper', agent: 'codex', name: 'p-task', title: 'Revise the introduction', instructions: 'Keep the meaning.', worktree: '/tmp/paper', threadId: 'thread', turnId: 'turn', model: null, effort: null, status: 'running', createdAt: 1, updatedAt: 1, feedbackCursor: 0, error: null, review: null }; const runtime = { connected: true, authenticated: true, account: null, error: null, models: [ { id: 'fast-model', name: 'Fast model', isDefault: true, efforts: ['low', 'medium', 'high'], defaultEffort: 'medium' }, - { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: 'Faster responses' } }, + { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', serviceTiers: ['priority', 'ultrafast'] }, ] }; const snapshot = { version: 'test', csrf: 'test', projects: [{ id: 'paper', name: 'Paper', path: '/tmp/paper', createdAt: 1 }], tasks: [task], requests: [], runtime, runtimes: { codex: runtime, claude: { ...runtime, models: [{ id: 'opus', name: 'Opus', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high' }] } } }; const modelChanges = [], messages = []; @@ -72,8 +72,11 @@ try { await taskEffort.press('End'); await expect.poll(() => task.effort).toBe('xhigh'); await expect(taskSettings).toContainText('Xhigh'); - await taskModelMenu.getByRole('switch', { name: 'Fast mode' }).check(); + const taskSpeed = taskModelMenu.getByRole('group', { name: 'Speed', exact: true }); + await taskSpeed.getByRole('radio', { name: 'Fast', exact: true }).check(); await expect.poll(() => task.serviceTier).toBe('priority'); + await taskSpeed.getByRole('radio', { name: 'Fast', exact: true }).press('ArrowRight'); + await expect.poll(() => task.serviceTier).toBe('ultrafast'); await taskModelMenu.getByRole('button', { name: 'Model default', exact: true }).click(); await expect.poll(() => task.effort).toBe(null); await expect(taskSettings).toContainText('High'); @@ -82,6 +85,7 @@ try { await taskModelMenu.getByRole('option', { name: 'Fast model · Codex', exact: true }).last().click(); await expect.poll(() => task.model).toBe('fast-model'); await expect(taskSettings).toContainText('Medium'); + await expect(taskSpeed).toHaveCount(0); assert.equal(task.effort, null, 'incompatible Xhigh resets to model default'); assert.equal(task.serviceTier, 'default'); await taskModelMenu.getByRole('combobox').press('Escape'); @@ -92,7 +96,7 @@ try { await taskModelMenu.getByRole('option', { name: 'Deep model · Codex', exact: true }).last().click(); await expect.poll(() => task.model).toBe('deep-model'); await expect(taskEffort, 'returning to a model restores its effort after reload').toHaveAttribute('aria-valuetext', 'Xhigh'); - assert.equal(task.serviceTier, 'priority', 'Fast mode is remembered with its model'); + assert.equal(task.serviceTier, 'ultrafast', 'Ultrafast is remembered with its model'); await taskModelMenu.getByRole('option', { name: 'Fast model · Codex', exact: true }).last().click(); await expect.poll(() => task.model).toBe('fast-model'); runtime.models[0].isDefault = false; @@ -133,21 +137,22 @@ try { await expect(taskEffort).toHaveAttribute('aria-valuetext', 'High'); assert.equal(task.effort, 'high', 'rapid model switches restore the preceding queued effort save'); const pickTaskModel = name => taskModelMenu.getByRole('option', { name: `${name} · Codex`, exact: true }).last().click(); - const fastSwitch = taskModelMenu.getByRole('switch', { name: 'Fast mode' }); + const standardSpeed = taskSpeed.getByRole('radio', { name: 'Standard', exact: true }); + const ultrafastSpeed = taskSpeed.getByRole('radio', { name: 'Ultrafast', exact: true }); await pickTaskModel('Deep model'); await expect.poll(() => task.model).toBe('deep-model'); - await taskEffort.press('Home'); await fastSwitch.uncheck(); + await taskEffort.press('Home'); await standardSpeed.check(); await expect(taskModelMenu.getByText('Saving…', { exact: true })).toHaveCount(0); holdModel = new Promise(resolve => { releaseModel = resolve; }); await taskEffort.press('End'); await pickTaskModel('Fast model'); await pickTaskModel('Deep model'); - await fastSwitch.check(); + await ultrafastSpeed.check(); releaseModel(); holdModel = null; await expect(taskModelMenu.getByText('Saving…', { exact: true })).toHaveCount(0); - assert.equal(task.effort, 'xhigh', 'a queued Fast toggle keeps the restored effort'); - assert.equal(task.serviceTier, 'priority'); + assert.equal(task.effort, 'xhigh', 'a queued speed change keeps the restored effort'); + assert.equal(task.serviceTier, 'ultrafast'); holdModel = new Promise(resolve => { releaseModel = resolve; }); - await fastSwitch.uncheck(); + await standardSpeed.check(); await pickTaskModel('Fast model'); await pickTaskModel('Deep model'); await taskEffort.press('Home'); releaseModel(); holdModel = null; @@ -329,7 +334,8 @@ try { }; await pick('Deep model · Codex'); await slider.press('End'); - await picker.getByRole('switch', { name: 'Fast mode' }).check(); + const ultrafast = picker.getByRole('radio', { name: 'Ultrafast', exact: true }); + await ultrafast.check(); await picker.getByRole('radio', { name: 'Full access', exact: true }).check(); await pick('Fast model · Codex'); await slider.press('Home'); @@ -338,7 +344,7 @@ try { await slider.press('Home'); await pick('Deep model · Codex'); await expect(slider).toHaveAttribute('aria-valuetext', 'Xhigh'); - await expect(picker.getByRole('switch', { name: 'Fast mode' })).toBeChecked(); + await expect(ultrafast).toBeChecked(); await expect(picker.getByRole('radio', { name: 'Full access', exact: true })).toBeChecked(); await composer.keyboard.press('Escape'); await composer.reload(); @@ -349,7 +355,7 @@ try { await composer.keyboard.press('Escape'); await composer.getByRole('textbox', { name: 'Describe the revision' }).fill('Use the remembered settings.'); await submit('deep-model'); - assert.equal(creates.at(-1).effort, 'xhigh'); assert.equal(creates.at(-1).permissions, 'full'); assert.equal(creates.at(-1).serviceTier, 'priority'); + assert.equal(creates.at(-1).effort, 'xhigh'); assert.equal(creates.at(-1).permissions, 'full'); assert.equal(creates.at(-1).serviceTier, 'ultrafast'); await pick('Fast model · Codex'); await expect(slider).toHaveAttribute('aria-valuetext', 'Low'); await pick('Opus · Claude'); @@ -379,6 +385,7 @@ try { await newSettings.click(); await expect(picker.getByRole('radio', { name: 'Full access', exact: true })).toBeChecked(); await expect(slider).toHaveAttribute('aria-valuetext', 'Xhigh'); + await expect(ultrafast).toBeChecked(); await composer.screenshot({ path: 'test-results/model-preferences-mobile-dark.png', animations: 'disabled' }); assert.deepEqual(errors, []); await fresh.close(); diff --git a/scripts/check-task-permissions.mjs b/scripts/check-task-permissions.mjs index 6f518076..1f54e02c 100644 --- a/scripts/check-task-permissions.mjs +++ b/scripts/check-task-permissions.mjs @@ -23,7 +23,7 @@ page.on('pageerror', error => errors.push(error.message)); const task = { id: 'fixture-task', projectId: 'paper', agent: 'codex', name: 'p-task', title: 'Revise the introduction', instructions: 'Keep the meaning.', worktree: '/tmp/paper', threadId: 'thread', turnId: 'turn', model: null, effort: null, status: 'running', createdAt: 1, updatedAt: 1, feedbackCursor: 0, error: null, review: null }; const runtime = { permissionOptions: new Codex().permissionOptions(), connected: true, authenticated: true, account: null, error: null, models: [ { id: 'fast-model', name: 'Fast model', isDefault: true, efforts: ['low', 'medium', 'high'], defaultEffort: 'medium' }, - { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: 'Faster responses' } }, + { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', serviceTiers: ['priority'] }, ] }; const snapshot = { version: 'test', csrf: 'test', projects: [{ id: 'paper', name: 'Paper', path: '/tmp/paper', createdAt: 1 }], tasks: [task], requests: [], runtime, runtimes: { codex: runtime, claude: { ...runtime, permissionOptions: Object.assign(new ClaudeAgent(undefined, undefined, undefined, 'linux'), { cli: '/fixture/claude' }).permissionOptions(), models: [{ id: 'opus', name: 'Opus', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high' }] } } }; snapshot.runtimes.kimi = { ...runtime, models: [{ id: 'kimi-k3', name: 'Kimi K3', isDefault: true, efforts: [] }], permissionOptions: [ diff --git a/scripts/check-ui.mjs b/scripts/check-ui.mjs index 59dad5e3..87a347ab 100644 --- a/scripts/check-ui.mjs +++ b/scripts/check-ui.mjs @@ -46,7 +46,7 @@ await page.addInitScript(() => { const pageErrors = []; page.on('pageerror', error => pageErrors.push(error.message)); const task = { id: 'fixture-task-0001', projectId: 'fixture-paper', name: 'p-fixture', title: 'Clarify the introduction', instructions: 'Keep the technical meaning.', worktree: '/tmp/fixture', threadId: null, turnId: null, model: null, status: 'reviewing', createdAt: 1, updatedAt: 1, feedbackCursor: 0, error: null, review: { state: 'reviewing', round: 1, counts: { pending: 3, commented: 1 } } }; -const snapshot = { version: 'test', csrf: 'fixture', projects: [{ id: task.projectId, name: 'Example paper', path: '/tmp/fixture', createdAt: 1 }], tasks: [task], requests: [], runtime: { connected: true, authenticated: true, account: null, error: null, models: [{ id: 'fast-model', name: 'Fast model', isDefault: true, efforts: ['low', 'medium', 'high'], defaultEffort: 'medium' }, { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: '2x speed, increased usage' } }], usage: { plan: 'pro', windows: [{ usedPercent: 83, minutes: 10080, resetsAt: Date.now() + 3 * 86_400_000 }], credits: { unlimited: false, balance: 12418.76 }, reached: false } } }; +const snapshot = { version: 'test', csrf: 'fixture', projects: [{ id: task.projectId, name: 'Example paper', path: '/tmp/fixture', createdAt: 1 }], tasks: [task], requests: [], runtime: { connected: true, authenticated: true, account: null, error: null, models: [{ id: 'fast-model', name: 'Fast model', isDefault: true, efforts: ['low', 'medium', 'high'], defaultEffort: 'medium' }, { id: 'deep-model', name: 'Deep model', isDefault: false, efforts: ['low', 'medium', 'high', 'xhigh'], defaultEffort: 'high', serviceTiers: ['priority'] }], usage: { plan: 'pro', windows: [{ usedPercent: 83, minutes: 10080, resetsAt: Date.now() + 3 * 86_400_000 }], credits: { unlimited: false, balance: 12418.76 }, reached: false } } }; // Claude is available with its own models; Antigravity is not installed. snapshot.runtimes = { codex: snapshot.runtime, claude: { connected: true, authenticated: true, account: 'Claude Max', error: null, models: [{ id: 'opus', name: 'Opus 5.5', isDefault: true, efforts: ['low', 'medium', 'high', 'xhigh', 'max'], defaultEffort: null }, { id: 'haiku', name: 'Haiku 5.5', isDefault: false, efforts: ['low', 'medium', 'high'], defaultEffort: null }] }, antigravity: { connected: false, authenticated: false, account: null, error: 'spawn agy ENOENT', models: [] }, kimi: { installed: true, connected: false, authenticated: false, account: null, error: null, models: [] }, cursor: { installed: false, connected: false, authenticated: false, account: null, error: null, models: [] } }; const messages = []; diff --git a/src/server/workspace.ts b/src/server/workspace.ts index f841cc56..04ccd0cf 100644 --- a/src/server/workspace.ts +++ b/src/server/workspace.ts @@ -47,7 +47,7 @@ import { canonicalGroup, groupsWithoutInstructions, parseGroupInstructions, type import { commitChanges, conflictMarkers, gitCommit, gitRemote, gitStatus, mergeConflicts, mergeInProgress, recentCommitSubjects } from './manuscript.ts'; import { Memory, memoryDigest, memoryUpdate } from './memory.ts'; import { MEMORY_EVIDENCE, MEMORY_LANGUAGE, MEMORY_LEARNING, MEMORY_SINCE, acceptedSuggestions, dismissedKey, evidenceHash, hasEvidence, learningPrompt, memoryLearningInstructions, taskEvidence, type EvidenceRecord, type MemoryEvidence } from './memory-learning.ts'; -import { AGENT_IDS, isAgentId, usesCodex, isTaskReviewNote, collaborationRoutes, type CollaborationRole, type CollaborationRoutes, type CollaborationSettings } from '../shared.ts'; +import { AGENT_IDS, isAgentId, usesCodex, modelServiceTier, isTaskReviewNote, collaborationRoutes, type CollaborationRole, type CollaborationRoutes, type CollaborationSettings } from '../shared.ts'; import type { HelperChoice, Task, TaskPermissions, Run, TimelineItem, PendingRequest, RuntimeStatus, Snapshot, PendingReview, PendingBuild, AgentModel, Usage, AgentId, MessageMeta, FeedbackSummary, BuildFailure, Annotation, NoteSummary, TaskReconciliation, TaskCommitReview, PageView, ToolPlace } from '../shared.ts'; const execute = promisify(execFile); @@ -58,15 +58,20 @@ const startsBuild = (route: string, value: unknown) => /\/source(?:\/file)?$/.te const errorText = (e: unknown) => e instanceof Error ? e.message : String(e); // A Codex model/list entry with the reasoning efforts it supports. export const agentModel = (m: any): AgentModel => { - // New catalogs name the wire tier explicitly; older ones advertise only "fast". - const fast = Array.isArray(m.serviceTiers) - ? m.serviceTiers.find((tier: any) => typeof tier?.id === 'string' && (tier.name === 'Fast' || tier.id === 'fast' || tier.id === 'priority')) - : m.additionalSpeedTiers?.includes('fast') ? { id: 'priority' } : undefined; + // Use explicit wire IDs when the catalog provides them. + const catalog: { id: string; name: string }[] = m.serviceTiers; + const legacyTiers = Array.isArray(m.additionalSpeedTiers) ? m.additionalSpeedTiers : []; + const serviceTiers = Array.isArray(catalog) + ? [ + catalog.find(tier => typeof tier?.id === 'string' && tier.id !== 'ultrafast' && (tier.name === 'Fast' || tier.id === 'fast' || tier.id === 'priority'))?.id, + catalog.find(tier => tier?.id === 'ultrafast')?.id, + ].filter((id): id is string => Boolean(id)) + : [legacyTiers.includes('fast') ? 'priority' : '', legacyTiers.includes('ultrafast') ? 'ultrafast' : ''].filter(Boolean); return { id: m.model || m.id, name: m.displayName || m.model || m.id, ...(typeof m.source === 'string' && m.source ? { source: m.source } : {}), isDefault: Boolean(m.isDefault), efforts: (m.supportedReasoningEfforts || []).map((e: any) => e?.reasoningEffort).filter((e: unknown) => typeof e === 'string'), defaultEffort: typeof m.defaultReasoningEffort === 'string' ? m.defaultReasoningEffort : null, - ...(fast ? { fastMode: { serviceTier: fast.id, description: typeof fast.description === 'string' ? fast.description : '' } } : {}), + ...(serviceTiers.length ? { serviceTiers } : {}), }; }; // An account/rateLimits/read response as the usage Papilot shows; null when @@ -714,7 +719,7 @@ export class Workspace extends EventEmitter { if (input.agent && input.agent !== 'codex') throw new Error('Service tiers are only available for Codex.'); const models = this.runtimes.codex.models; const model = input.model ? models.find(model => model.id === input.model) : models.find(model => model.isDefault); - if (input.serviceTier !== 'default' && input.serviceTier !== model?.fastMode?.serviceTier) throw new Error('Fast mode is not available for this model.'); + if (input.serviceTier !== modelServiceTier(model, input.serviceTier)) throw new Error('This speed is not available for this model.'); } const project = this.store.project(input.projectId), skill = input.skill ? findSkill(project.path, input.skill) : undefined; if (skill?.output === 'annotations' && !input.prepareReview) throw new Error('Start a new task to run the AI review skill on the current PDF.'); @@ -783,7 +788,7 @@ export class Workspace extends EventEmitter { const model = runtime.models.find(model => input.model ? model.id === input.model : model.isDefault); if (!model && (input.model || runtime.models.length)) throw new Error('Choose an available model for the destination agent.'); if (input.effort && !model?.efforts.includes(input.effort)) throw new Error('This model does not support that reasoning effort.'); - if (input.serviceTier && input.serviceTier !== 'default' && (input.agent !== 'codex' || input.serviceTier !== model?.fastMode?.serviceTier)) throw new Error('Fast mode is not available for this model.'); + if (input.serviceTier && input.serviceTier !== 'default' && (input.agent !== 'codex' || input.serviceTier !== modelServiceTier(model, input.serviceTier))) throw new Error('This speed is not available for this model.'); this.validateTaskPermissions(permissions, input.agent, task.mode === 'review'); return model; }; @@ -1228,10 +1233,14 @@ ${['antigravity', 'zcode'].includes(this.agentOf(task)) ? 'Use file tools for ma const models = this.runtimes[this.agentOf(task)].models; const model = task.model ? models.find(model => model.id === task.model) : models.find(model => model.isDefault); // Explicit defaults replace a previous turn's reasoning override. - const effort = task.effort || (usesCodex(this.agentOf(task)) ? model?.defaultEffort : undefined); + const codex = usesCodex(this.agentOf(task)); + const effort = task.effort || (codex ? model?.defaultEffort : undefined); + // A catalog refresh can remove an accelerated speed from an existing task. + // Keep the saved choice and preserve host inheritance for tasks without one. + const serviceTier = task.serviceTier && model ? modelServiceTier(model, task.serviceTier) : task.serviceTier; // Apply the native policy (including configured roots and tmp exclusions) // and the current worktree reviewer even on already-loaded threads. - try { result = await agent.request('turn/start', { threadId: task.threadId, input, cwd: task.worktree, ...permissions?.turn, ...reviewer, clientUserMessageId: run.id, ...(task.model ? { model: task.model } : {}), ...(effort ? { effort } : {}), ...(usesCodex(this.agentOf(task)) && task.serviceTier ? { serviceTier: task.serviceTier } : {}) }); } + try { result = await agent.request('turn/start', { threadId: task.threadId, input, cwd: task.worktree, ...permissions?.turn, ...reviewer, clientUserMessageId: run.id, ...(task.model ? { model: task.model } : {}), ...(effort ? { effort } : {}), ...(codex && serviceTier ? { serviceTier } : {}) }); } catch (error) { if (this.active.get(task.id)?.id !== run.id) return; if (error instanceof RpcResponseError) throw error; @@ -2468,7 +2477,7 @@ ${['antigravity', 'zcode'].includes(this.agentOf(task)) ? 'Use file tools for ma const project = this.store.project(projectId), { id, model } = this.helper(choice, 'write a commit message', { readOnly: true, strict: 'commit-message' }); if (choice.model && model?.id !== choice.model) throw new Error('Choose an available model for this agent.'); if (choice.effort && model && !model.efforts.includes(choice.effort)) throw new Error('This model does not support that reasoning effort.'); - if (choice.serviceTier && choice.serviceTier !== 'default' && (id !== 'codex' || choice.serviceTier !== model?.fastMode?.serviceTier)) throw new Error('Fast mode is not available for this model.'); + if (choice.serviceTier && choice.serviceTier !== 'default' && (id !== 'codex' || choice.serviceTier !== modelServiceTier(model, choice.serviceTier))) throw new Error('This speed is not available for this model.'); const effort = choice.effort || model?.defaultEffort, serviceTier = id === 'codex' ? choice.serviceTier : undefined; const task = choice.taskId ? this.store.task(choice.taskId) : undefined; if (task && task.projectId !== projectId) throw new Error('Invalid task ID.'); @@ -2588,7 +2597,7 @@ ${['antigravity', 'zcode'].includes(this.agentOf(task)) ? 'Use file tools for ma const project = this.store.project(projectId), { id, model } = this.helper(choice, 'resolve conflicts', { strict: 'conflict-resolution' }); if (choice.model && model?.id !== choice.model) throw new Error('Choose an available model for this agent.'); if (choice.effort && !model?.efforts.includes(choice.effort)) throw new Error('This model does not support that reasoning effort.'); - if (choice.serviceTier && choice.serviceTier !== 'default' && (id !== 'codex' || choice.serviceTier !== model?.fastMode?.serviceTier)) throw new Error('Fast mode is not available for this model.'); + if (choice.serviceTier && choice.serviceTier !== 'default' && (id !== 'codex' || choice.serviceTier !== modelServiceTier(model, choice.serviceTier))) throw new Error('This speed is not available for this model.'); const effort = choice.effort || model?.defaultEffort, serviceTier = id === 'codex' ? choice.serviceTier : undefined; const { files, branch, upstream, ours, theirs } = await mergeConflicts(project.path); if (!files.length) throw new Error('No file has conflict markers left. Commit the merge.'); @@ -2643,9 +2652,9 @@ ${['antigravity', 'zcode'].includes(this.agentOf(task)) ? 'Use file tools for ma if (change.model && change.model !== task.model && !model) throw new Error('Choose an available model for this agent.'); const effort = change.effort ?? (change.model !== undefined && model && !model.efforts.includes(task.effort || '') ? '' : task.effort); if (change.effort && model && !model.efforts.includes(change.effort)) throw new Error('This model does not support that reasoning effort.'); - const serviceTier = change.serviceTier ?? (change.model !== undefined && task.serviceTier !== model?.fastMode?.serviceTier ? 'default' : task.serviceTier); + const serviceTier = change.serviceTier ?? (task.serviceTier && (model || change.model !== undefined) ? modelServiceTier(model, task.serviceTier) : task.serviceTier); if (change.serviceTier !== undefined && agent !== 'codex') throw new Error('Service tiers are only available for Codex.'); - if (serviceTier && serviceTier !== 'default' && serviceTier !== model?.fastMode?.serviceTier) throw new Error('Fast mode is not available for this model.'); + if (change.serviceTier && change.serviceTier !== modelServiceTier(model, change.serviceTier)) throw new Error('This speed is not available for this model.'); return this.store.updateTask(taskId, { model: id || null, effort: effort || null, ...(serviceTier ? { serviceTier } : {}) }); } renameTask(taskId: string, title: string) { diff --git a/src/shared.ts b/src/shared.ts index 6ee438cb..3bcbb0e1 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -210,7 +210,11 @@ export interface WriterLogin { id: string; provider: string; name: string; statu export interface WriterAuth { providers: WriterProvider[]; logins: WriterLogin[]; customApi?: WriterCustomApi } export const isAgentId = (value: unknown): value is AgentId => AGENT_IDS.includes(value as AgentId); /** source: where an agent with several model providers gets this model, such as a subscription. */ -export interface AgentModel { id: string; name: string; source?: string; isDefault: boolean; efforts: string[]; defaultEffort: string | null; fastMode?: { serviceTier: string; description: string } } +export interface AgentModel { id: string; name: string; source?: string; isDefault: boolean; efforts: string[]; defaultEffort: string | null; serviceTiers?: string[] } + +export function modelServiceTier(model: AgentModel | undefined, tier?: string) { + return tier && model?.serviceTiers?.includes(tier) ? tier : 'default'; +} // The account's included usage: rolling windows (minutes long, reset time in ms) and credits. export interface UsageWindow { usedPercent: number; minutes: number | null; resetsAt: number | null; scope?: string; label?: string } export interface Usage { plan: string | null; windows: UsageWindow[]; credits: { unlimited: boolean; balance: number | null } | null; reached: boolean } diff --git a/src/web/agent-picker.tsx b/src/web/agent-picker.tsx index cab2f78f..42fc5d68 100644 --- a/src/web/agent-picker.tsx +++ b/src/web/agent-picker.tsx @@ -1,5 +1,5 @@ import { Fragment, type ReactNode, useEffect, useId, useLayoutEffect, useRef, useState } from 'react'; -import type { AgentId, RuntimeStatus, TaskPermissions } from '../shared.ts'; +import { modelServiceTier, type AgentId, type RuntimeStatus, type TaskPermissions } from '../shared.ts'; import { Icon } from './icons.tsx'; import { BrandIcon } from './brand-icon.tsx'; import { errorText, t } from './i18n.ts'; @@ -77,6 +77,11 @@ function bySource(items: Choice[]) { } interface Choice { key: string; agent: AgentOption; model: string; name: string; source?: string; isDefault: boolean; recent: boolean } +function speedName(tier: string) { + if (tier === 'default') return t('Standard'); + return tier === 'ultrafast' ? t('Ultrafast') : t('Fast'); +} + // An agent's state when it cannot be used yet, shown beside its name. function agentState(runtime?: RuntimeStatus) { if (runtime?.installed === false) return t('Not found'); @@ -87,13 +92,13 @@ function agentState(runtime?: RuntimeStatus) { // One compact trigger opens a searchable list of every agent's models, // grouped by agent with recent choices first, so one choice sets both. The -// selected model's reasoning effort, fast mode and permissions sit below the list. Native +// selected model's reasoning effort, speed and permissions sit below the list. Native // popovers keep the menu above the PDF and scrolling panels, with // outside-click and Escape dismissal. -export function AgentPicker({ label, agents, agent, model, effort, fast, reconnecting, onReconnect, onSelect, onChange, disabled, description, permissions, permissionMode, allowUnknownDefault = true, noAgent = false, refreshUsage }: { - label?: string; agents: AgentOption[]; agent: AgentId; model: string; effort: string; fast: boolean; +export function AgentPicker({ label, agents, agent, model, effort, serviceTier, reconnecting, onReconnect, onSelect, onChange, disabled, description, permissions, permissionMode, allowUnknownDefault = true, noAgent = false, refreshUsage }: { + label?: string; agents: AgentOption[]; agent: AgentId; model: string; effort: string; serviceTier?: string; reconnecting: boolean; onReconnect: () => void; - onSelect: (agent: AgentId, model: string) => void; onChange: (change: Partial<{ effort: string; fast: boolean }>) => void; disabled?: boolean; description?: string; allowUnknownDefault?: boolean; + onSelect: (agent: AgentId, model: string) => void; onChange: (change: Partial<{ effort: string; serviceTier: string }>) => void; disabled?: boolean; description?: string; allowUnknownDefault?: boolean; permissions?: ReactNode; permissionMode?: TaskPermissions; noAgent?: boolean; refreshUsage?: RefreshUsage; }) { @@ -105,10 +110,12 @@ export function AgentPicker({ label, agents, agent, model, effort, fast, reconne const agentName = current?.label || agent; const modelName = selected?.name || model || t('Default model'); const currentEffort = effort || selected?.defaultEffort; - const fastMode = agent === 'codex' ? selected?.fastMode : undefined; + const tiers = agent === 'codex' && serviceTier !== undefined ? selected?.serviceTiers : undefined; + const speed = modelServiceTier(selected, serviceTier); + const accelerated = Boolean(tiers?.includes(speed)); const permission = runtime?.permissionOptions?.find(option => option.value === permissionMode); const disconnected = runtime && (!runtime.connected || !runtime.authenticated); - const summary = noAgent ? t('No agent') : [agentName, modelName, currentEffort ? effortName(currentEffort) : '', fastMode && fast ? t('Fast') : '', permission ? permissionText(permission.label) : ''].filter((part, index, all) => part && all.indexOf(part) === index).join(' · '); + const summary = noAgent ? t('No agent') : [agentName, modelName, currentEffort ? effortName(currentEffort) : '', accelerated ? speedName(speed) : '', permission ? permissionText(permission.label) : ''].filter((part, index, all) => part && all.indexOf(part) === index).join(' · '); // Every model of every agent that the author did not hide; an agent without a model list offers its default. const choices = (option: AgentOption): Choice[] => { const list = option.runtime?.models || []; @@ -192,7 +199,7 @@ export function AgentPicker({ label, agents, agent, model, effort, fast, reconne onKeyDown={event => { if (event.key === 'ArrowDown') { event.preventDefault(); show(); } }}> {noAgent ? {t('No agent')} : <>{!permission && modelName !== agentName && {agentName}} - + {permission && {permissionText(permission.label)}} {disconnected && }} @@ -224,7 +231,19 @@ export function AgentPicker({ label, agents, agent, model, effort, fast, reconne {open && runtime?.connected && runtime.authenticated && (agent === 'antigravity' || runtime.usage) && } {description &&

{description}

} {selected?.efforts.length ? onChange({ effort: value })}/> : null} - {fastMode && } + {tiers?.includes('ultrafast') ?
+ {t('Speed')} + {t('Faster, higher usage')} +
+ {['default', ...tiers].map(tier => )} +
+
: tiers?.length ? : null} {permissions} ; diff --git a/src/web/agent-preferences.ts b/src/web/agent-preferences.ts index 1dbe7a51..a2c6afc3 100644 --- a/src/web/agent-preferences.ts +++ b/src/web/agent-preferences.ts @@ -3,7 +3,7 @@ import { AGENT_IDS, type AgentId, type AgentModel, type RuntimeStatus, type Task import { browserStorage } from './storage.ts'; type Storage = Pick; -export interface ModelPreferences { effort: string | null; fast: boolean } +export interface ModelPreferences { effort: string | null; serviceTier: string } const modelKey = (agent: AgentId, model: string) => 'papilot:model-preferences:' + JSON.stringify([agent, model]); const permissionKey = (agent: AgentId) => 'papilot:permissions:' + agent; @@ -25,7 +25,13 @@ export function readModelPreferences(agent: AgentId, id: string, model?: AgentMo ?? (model?.isDefault ? storage.getItem(modelKey(agent, '')) : null); try { const saved = JSON.parse(value || 'null'); - if (saved && (saved.effort === null || typeof saved.effort === 'string') && typeof saved.fast === 'boolean') return { effort: saved.effort, fast: saved.fast }; + if (saved && (saved.effort === null || typeof saved.effort === 'string')) { + if (typeof saved.serviceTier === 'string') return { effort: saved.effort, serviceTier: saved.serviceTier }; + if (typeof saved.fast === 'boolean') { + const fastTier = model?.serviceTiers?.find(tier => tier !== 'ultrafast') || 'priority'; + return { effort: saved.effort, serviceTier: saved.fast ? fastTier : 'default' }; + } + } } catch { /* A damaged preference uses the normal model defaults. */ } return null; } diff --git a/src/web/citation-check.tsx b/src/web/citation-check.tsx index 0c6eca71..a5d546de 100644 --- a/src/web/citation-check.tsx +++ b/src/web/citation-check.tsx @@ -80,7 +80,7 @@ export function CitationCheckView({ task, load, agents, lead, onOpen, onCite, re void act('show', { show: event.target.checked })}/> {t('Show in the paper')} - {choice && { if (!reconnect) return; setReconnecting(true); void reconnect().finally(() => setReconnecting(false)); }} onSelect={(agent, selected) => setChoice({ agent, model: selected || null, effort: null })} onChange={change => { if (change.effort !== undefined) setChoice(current => current && ({ ...current, effort: change.effort || null })); }}/>} {running diff --git a/src/web/commit-agent-settings.tsx b/src/web/commit-agent-settings.tsx index 68aad805..6f68282f 100644 --- a/src/web/commit-agent-settings.tsx +++ b/src/web/commit-agent-settings.tsx @@ -3,6 +3,7 @@ import { AgentPicker, type AgentOption } from './agent-picker.tsx'; import { agentLabel } from './agent-choice.ts'; import { saveCommitMessageAgent, useCommitMessageAgent, saveConflictAgent, useConflictAgent, type CommitMessageAgent, type CommitMessageChoice } from './commit-agent-preferences.ts'; import { t } from './i18n.ts'; +import { modelServiceTier } from '../shared.ts'; import type { RefreshUsage } from './usage.tsx'; type AgentSettingsProps = { current: CommitMessageChoice; agents: AgentOption[]; reconnect?: () => Promise; refreshUsage?: RefreshUsage }; @@ -26,8 +27,6 @@ function HelperAgentSettings({ current, agents, reconnect, refreshUsage, prefere const [reconnecting, setReconnecting] = useState(false), [error, setError] = useState(''); const following = preference === 'conversation'; const options = agents.some(item => item.value === current.agent) ? agents : [...agents, { value: current.agent, label: agentLabel(current.agent), runtime: { connected: false, authenticated: false, installed: false, account: null, error: null, models: [] } }]; - const models = options.find(item => item.value === current.agent)?.runtime?.models || []; - const model = models.find(item => current.model ? item.id === current.model : item.isDefault); return <>
@@ -38,13 +37,13 @@ function HelperAgentSettings({ current, agents, reconnect, refreshUsage, prefere
{label}{error &&

{error}

}
- { if (!reconnect) return; setReconnecting(true); setError(''); void reconnect().catch(error => setError(error instanceof Error ? error.message : String(error))).finally(() => setReconnecting(false)); }} onSelect={(agent, selected) => { const next = options.find(item => item.value === agent)?.runtime?.models.find(item => selected ? item.id === selected : item.isDefault); - save({ agent, model: selected, effort: next?.efforts.includes(current.effort) ? current.effort : '', ...(agent === 'codex' ? { serviceTier: current.agent === agent && next?.fastMode?.serviceTier === current.serviceTier ? current.serviceTier : 'default' } : {}) }); + save({ agent, model: selected, effort: next?.efforts.includes(current.effort) ? current.effort : '', ...(agent === 'codex' ? { serviceTier: modelServiceTier(next, current.agent === agent ? current.serviceTier : undefined) } : {}) }); }} - onChange={change => save({ ...current, ...(change.effort !== undefined ? { effort: change.effort } : {}), ...(change.fast !== undefined ? { serviceTier: change.fast ? model?.fastMode?.serviceTier : 'default' } : {}) })}/> + onChange={change => save({ ...current, ...change })}/>
; } diff --git a/src/web/locales/de.json b/src/web/locales/de.json index e3f9ace5..f3441b74 100644 --- a/src/web/locales/de.json +++ b/src/web/locales/de.json @@ -1322,6 +1322,7 @@ "Source": "Quelltext", "Source unavailable": "Quelle nicht verfügbar", "Sparkles": "Funken", + "Speed": "Geschwindigkeit", "Spelling": "Rechtschreibung", "Spend": "Ausgaben", "Split": "Geteilt", @@ -1331,6 +1332,7 @@ "Stage {path}": "{path} vormerken", "Staged": "Vorgemerkt", "Staged changes": "Vorgemerkte Änderungen", + "Standard": "Standard", "Standard shortcuts": "Standard-Tastenkürzel", "Start syncing": "Synchronisierung starten", "Start task": "Aufgabe starten", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Satz- und weitere Hinweise", "Typesetting with LaTeX, pass {n}…": "Satz mit LaTeX, Durchlauf {n}…", "Typos, word choice and small LaTeX fixes": "Tippfehler, Wortwahl und kleine LaTeX-Korrekturen", + "Ultrafast": "Ultraschnell", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Nicht übernommene Bearbeitungen und Kommentare gehen verloren. Übernommene Änderungen bleiben in Ihrem Manuskript erhalten.", "Unavailable": "Nicht verfügbar", "Unchanged context": "Unveränderter Kontext", diff --git a/src/web/locales/errors/de.json b/src/web/locales/errors/de.json index 4cfe5adb..5a1d5f8b 100644 --- a/src/web/locales/errors/de.json +++ b/src/web/locales/errors/de.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Geben Sie einen absoluten Ordnerpfad auf dem Computer ein, auf dem Papilot läuft.", "Enter the address of the Overleaf server.": "Geben Sie die Adresse des Overleaf-Servers ein.", "Evidence must name a source file inside this task.": "Belege müssen eine Quelldatei innerhalb dieser Aufgabe benennen.", - "Fast mode is not available for this model.": "Der Schnellmodus ist für dieses Modell nicht verfügbar.", "Files must be 25 MB or smaller.": "Dateien dürfen maximal 25 MB groß sein.", "Finish or abort the merge before committing other changes.": "Schließen Sie den Merge ab oder brechen Sie ihn ab, bevor Sie weitere Änderungen committen.", "Finish or abort the merge before discarding changes.": "Schließen Sie den Merge ab oder brechen Sie ihn ab, bevor Sie Änderungen verwerfen.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Diese Anmeldung wartet nicht auf einen Code.", "This source file is too large to edit here.": "Diese Quelldatei ist zu groß, um sie hier zu bearbeiten.", "This source file no longer exists.": "Diese Quelldatei existiert nicht mehr.", + "This speed is not available for this model.": "Diese Geschwindigkeit ist für dieses Modell nicht verfügbar.", "This suggestion does not belong to this review task.": "Dieser Vorschlag gehört nicht zu dieser Überprüfungsaufgabe.", "This suggestion is no longer available.": "Dieser Vorschlag ist nicht mehr verfügbar.", "This suggestion was ignored while copying. Restore it first.": "Dieser Vorschlag wurde beim Kopieren ignoriert. Stellen Sie ihn zuerst wieder her.", diff --git a/src/web/locales/errors/es.json b/src/web/locales/errors/es.json index d2139bc4..76ab783d 100644 --- a/src/web/locales/errors/es.json +++ b/src/web/locales/errors/es.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Introduce una ruta de carpeta absoluta en el equipo que ejecuta Papilot.", "Enter the address of the Overleaf server.": "Introduce la dirección del servidor de Overleaf.", "Evidence must name a source file inside this task.": "Las pruebas deben indicar un archivo fuente de esta tarea.", - "Fast mode is not available for this model.": "El modo rápido no está disponible para este modelo.", "Files must be 25 MB or smaller.": "Los archivos deben ser de 25 MB o menos.", "Finish or abort the merge before committing other changes.": "Finaliza o cancela la fusión antes de confirmar otros cambios.", "Finish or abort the merge before discarding changes.": "Finaliza o cancela la fusión antes de descartar los cambios.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Este inicio de sesión no está esperando un código.", "This source file is too large to edit here.": "Este archivo fuente es demasiado grande para editarlo aquí.", "This source file no longer exists.": "Este archivo fuente ya no existe.", + "This speed is not available for this model.": "Esta velocidad no está disponible para este modelo.", "This suggestion does not belong to this review task.": "Esta sugerencia no pertenece a esta tarea de revisión.", "This suggestion is no longer available.": "Esta sugerencia ya no está disponible.", "This suggestion was ignored while copying. Restore it first.": "Esta sugerencia se ignoró al copiar. Restáurala primero.", diff --git a/src/web/locales/errors/fr.json b/src/web/locales/errors/fr.json index bb011a53..b2df83e6 100644 --- a/src/web/locales/errors/fr.json +++ b/src/web/locales/errors/fr.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Saisissez un chemin de dossier absolu sur l’ordinateur qui exécute Papilot.", "Enter the address of the Overleaf server.": "Saisissez l’adresse du serveur Overleaf.", "Evidence must name a source file inside this task.": "Les preuves doivent désigner un fichier source dans cette tâche.", - "Fast mode is not available for this model.": "Le mode rapide n’est pas disponible pour ce modèle.", "Files must be 25 MB or smaller.": "Les fichiers ne doivent pas dépasser 25 Mo.", "Finish or abort the merge before committing other changes.": "Terminez ou annulez la fusion avant de valider d’autres modifications.", "Finish or abort the merge before discarding changes.": "Terminez ou abandonnez la fusion avant d’annuler les modifications.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Cette connexion n’attend pas de code.", "This source file is too large to edit here.": "Ce fichier source est trop volumineux pour être modifié ici.", "This source file no longer exists.": "Ce fichier source n'existe plus.", + "This speed is not available for this model.": "Cette vitesse n’est pas disponible pour ce modèle.", "This suggestion does not belong to this review task.": "Cette suggestion n’appartient pas à cette tâche de révision.", "This suggestion is no longer available.": "Cette suggestion n’est plus disponible.", "This suggestion was ignored while copying. Restore it first.": "Cette suggestion a été ignorée lors de la copie. Restaurez-la d’abord.", diff --git a/src/web/locales/errors/it.json b/src/web/locales/errors/it.json index 863f4786..8984c37a 100644 --- a/src/web/locales/errors/it.json +++ b/src/web/locales/errors/it.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Inserisci un percorso assoluto di cartella sul computer che esegue Papilot.", "Enter the address of the Overleaf server.": "Inserisci l'indirizzo del server Overleaf.", "Evidence must name a source file inside this task.": "Le evidenze devono indicare un file sorgente all’interno di questa attività.", - "Fast mode is not available for this model.": "La modalità veloce non è disponibile per questo modello.", "Files must be 25 MB or smaller.": "I file non devono superare 25 MB.", "Finish or abort the merge before committing other changes.": "Completa o annulla il merge prima di eseguire il commit di altre modifiche.", "Finish or abort the merge before discarding changes.": "Completa o annulla l'unione prima di scartare le modifiche.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Questo accesso non è in attesa di un codice.", "This source file is too large to edit here.": "Questo file sorgente è troppo grande per essere modificato qui.", "This source file no longer exists.": "Questo file sorgente non esiste più.", + "This speed is not available for this model.": "Questa velocità non è disponibile per questo modello.", "This suggestion does not belong to this review task.": "Questo suggerimento non appartiene a questa attività di revisione.", "This suggestion is no longer available.": "Questo suggerimento non è più disponibile.", "This suggestion was ignored while copying. Restore it first.": "Questo suggerimento è stato ignorato durante la copia. Ripristinalo prima.", diff --git a/src/web/locales/errors/ja.json b/src/web/locales/errors/ja.json index f42d77fe..5c60c536 100644 --- a/src/web/locales/errors/ja.json +++ b/src/web/locales/errors/ja.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Papilot を実行しているコンピューター上のフォルダーの絶対パスを入力してください。", "Enter the address of the Overleaf server.": "Overleaf サーバーのアドレスを入力してください。", "Evidence must name a source file inside this task.": "根拠には、このタスク内のソースファイルを指定してください。", - "Fast mode is not available for this model.": "このモデルでは高速モードを利用できません。", "Files must be 25 MB or smaller.": "ファイルは 25 MB 以下にする必要があります。", "Finish or abort the merge before committing other changes.": "他の変更をコミットする前に、マージを完了するか中止してください。", "Finish or abort the merge before discarding changes.": "変更を破棄する前に、マージを完了するか中止してください。", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "このサインインはコードを待っていません。", "This source file is too large to edit here.": "このソースファイルは大きすぎるため、ここでは編集できません。", "This source file no longer exists.": "このソースファイルはすでに存在しません。", + "This speed is not available for this model.": "このモデルではこの速度を利用できません。", "This suggestion does not belong to this review task.": "この提案はこのレビュータスクに属していません。", "This suggestion is no longer available.": "この提案は現在利用できません。", "This suggestion was ignored while copying. Restore it first.": "この提案はコピー時に無視されました。先に復元してください。", diff --git a/src/web/locales/errors/ko.json b/src/web/locales/errors/ko.json index 062ee73b..86866a27 100644 --- a/src/web/locales/errors/ko.json +++ b/src/web/locales/errors/ko.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Papilot을 실행하는 컴퓨터의 절대 폴더 경로를 입력하세요.", "Enter the address of the Overleaf server.": "Overleaf 서버 주소를 입력하세요.", "Evidence must name a source file inside this task.": "근거는 이 작업 안의 소스 파일을 가리켜야 합니다.", - "Fast mode is not available for this model.": "이 모델에서는 빠른 모드를 사용할 수 없습니다.", "Files must be 25 MB or smaller.": "파일 크기는 25MB 이하여야 합니다.", "Finish or abort the merge before committing other changes.": "다른 변경 사항을 커밋하기 전에 병합을 완료하거나 중단하세요.", "Finish or abort the merge before discarding changes.": "변경 사항을 취소하기 전에 병합을 완료하거나 중단하세요.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "이 로그인은 코드를 기다리고 있지 않습니다.", "This source file is too large to edit here.": "이 소스 파일은 너무 커서 여기서 편집할 수 없습니다.", "This source file no longer exists.": "이 소스 파일이 더 이상 존재하지 않습니다.", + "This speed is not available for this model.": "이 모델에서는 이 속도를 사용할 수 없습니다.", "This suggestion does not belong to this review task.": "이 제안은 이 검토 작업에 속하지 않습니다.", "This suggestion is no longer available.": "이 제안은 더 이상 사용할 수 없습니다.", "This suggestion was ignored while copying. Restore it first.": "복사하는 동안 이 제안이 무시되었습니다. 먼저 복원하세요.", diff --git a/src/web/locales/errors/pt.json b/src/web/locales/errors/pt.json index 8bb58d79..17d39a7e 100644 --- a/src/web/locales/errors/pt.json +++ b/src/web/locales/errors/pt.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Digite um caminho absoluto de pasta no computador que executa o Papilot.", "Enter the address of the Overleaf server.": "Insira o endereço do servidor do Overleaf.", "Evidence must name a source file inside this task.": "As evidências devem indicar um arquivo-fonte desta tarefa.", - "Fast mode is not available for this model.": "O modo rápido não está disponível para este modelo.", "Files must be 25 MB or smaller.": "Os arquivos devem ter 25 MB ou menos.", "Finish or abort the merge before committing other changes.": "Conclua ou cancele a mesclagem antes de confirmar outras alterações.", "Finish or abort the merge before discarding changes.": "Conclua ou aborte a mesclagem antes de descartar as alterações.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Este login não está aguardando um código.", "This source file is too large to edit here.": "Este arquivo-fonte é grande demais para ser editado aqui.", "This source file no longer exists.": "Este arquivo-fonte não existe mais.", + "This speed is not available for this model.": "Esta velocidade não está disponível para este modelo.", "This suggestion does not belong to this review task.": "Esta sugestão não pertence a esta tarefa de revisão.", "This suggestion is no longer available.": "Esta sugestão não está mais disponível.", "This suggestion was ignored while copying. Restore it first.": "Esta sugestão foi ignorada ao copiar. Restaure-a primeiro.", diff --git a/src/web/locales/errors/sv.json b/src/web/locales/errors/sv.json index 54cca402..0bfb8a0c 100644 --- a/src/web/locales/errors/sv.json +++ b/src/web/locales/errors/sv.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "Ange en absolut mappsökväg på datorn som kör Papilot.", "Enter the address of the Overleaf server.": "Ange adressen till Overleaf-servern.", "Evidence must name a source file inside this task.": "Beläggen måste ange en källfil inom den här uppgiften.", - "Fast mode is not available for this model.": "Snabbläge är inte tillgängligt för den här modellen.", "Files must be 25 MB or smaller.": "Filer får vara högst 25 MB.", "Finish or abort the merge before committing other changes.": "Slutför eller avbryt sammanslagningen innan du checkar in andra ändringar.", "Finish or abort the merge before discarding changes.": "Slutför eller avbryt sammanslagningen innan du förkastar ändringar.", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "Den här inloggningen väntar inte på någon kod.", "This source file is too large to edit here.": "Den här källfilen är för stor för att redigeras här.", "This source file no longer exists.": "Den här källfilen finns inte längre.", + "This speed is not available for this model.": "Den här hastigheten är inte tillgänglig för den här modellen.", "This suggestion does not belong to this review task.": "Det här förslaget tillhör inte den här granskningsuppgiften.", "This suggestion is no longer available.": "Det här förslaget är inte längre tillgängligt.", "This suggestion was ignored while copying. Restore it first.": "Det här förslaget ignorerades vid kopiering. Återställ det först.", diff --git a/src/web/locales/errors/zh-CN.json b/src/web/locales/errors/zh-CN.json index e89dec5e..45cb2b9e 100644 --- a/src/web/locales/errors/zh-CN.json +++ b/src/web/locales/errors/zh-CN.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "请输入运行 Papilot 的电脑上的绝对文件夹路径。", "Enter the address of the Overleaf server.": "请输入 Overleaf 服务器地址。", "Evidence must name a source file inside this task.": "依据必须指向此任务内的源文件。", - "Fast mode is not available for this model.": "此模型不支持快速模式。", "Files must be 25 MB or smaller.": "文件大小不得超过 25 MB。", "Finish or abort the merge before committing other changes.": "请先完成或中止合并,然后再提交其他更改。", "Finish or abort the merge before discarding changes.": "请先完成或中止合并,再放弃更改。", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "此次登录未在等待验证码。", "This source file is too large to edit here.": "此源文件过大,无法在此处编辑。", "This source file no longer exists.": "此源文件已不存在。", + "This speed is not available for this model.": "此模型不支持该速度。", "This suggestion does not belong to this review task.": "此建议不属于该审阅任务。", "This suggestion is no longer available.": "此建议已不可用。", "This suggestion was ignored while copying. Restore it first.": "复制时此建议已被忽略,请先将其恢复。", diff --git a/src/web/locales/errors/zh-Hant.json b/src/web/locales/errors/zh-Hant.json index 44385c21..f15c75d5 100644 --- a/src/web/locales/errors/zh-Hant.json +++ b/src/web/locales/errors/zh-Hant.json @@ -126,7 +126,6 @@ "Enter an absolute folder path on the computer running Papilot.": "請輸入執行 Papilot 的電腦上的絕對資料夾路徑。", "Enter the address of the Overleaf server.": "請輸入 Overleaf 伺服器的位址。", "Evidence must name a source file inside this task.": "依據必須指向此任務內的原始碼檔案。", - "Fast mode is not available for this model.": "此模型不支援快速模式。", "Files must be 25 MB or smaller.": "檔案大小不得超過 25 MB。", "Finish or abort the merge before committing other changes.": "請先完成或中止合併,再提交其他變更。", "Finish or abort the merge before discarding changes.": "捨棄變更前,請先完成或中止合併。", @@ -459,6 +458,7 @@ "This sign-in is not waiting for a code.": "此次登入未在等待代碼。", "This source file is too large to edit here.": "此原始碼檔案過大,無法在此處編輯。", "This source file no longer exists.": "此原始碼檔案已不存在。", + "This speed is not available for this model.": "此模型不支援此速度。", "This suggestion does not belong to this review task.": "此建議不屬於此審閱任務。", "This suggestion is no longer available.": "此建議已不再提供。", "This suggestion was ignored while copying. Restore it first.": "此建議在複製時已被略過。請先將其還原。", diff --git a/src/web/locales/es.json b/src/web/locales/es.json index 0b687be3..e13ab9be 100644 --- a/src/web/locales/es.json +++ b/src/web/locales/es.json @@ -1322,6 +1322,7 @@ "Source": "Código fuente", "Source unavailable": "Fuente no disponible", "Sparkles": "Destellos", + "Speed": "Velocidad", "Spelling": "Ortografía", "Spend": "Gasto", "Split": "Dividir", @@ -1331,6 +1332,7 @@ "Stage {path}": "Preparar {path}", "Staged": "Preparados", "Staged changes": "Cambios preparados", + "Standard": "Estándar", "Standard shortcuts": "Atajos estándar", "Start syncing": "Iniciar sincronización", "Start task": "Iniciar tarea", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Composición tipográfica y otras observaciones", "Typesetting with LaTeX, pass {n}…": "Componiendo con LaTeX, pasada {n}…", "Typos, word choice and small LaTeX fixes": "Erratas, elección de palabras y pequeñas correcciones de LaTeX", + "Ultrafast": "Ultrarrápido", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Las ediciones y los comentarios no aceptados se perderán. Los cambios aceptados permanecerán en tu manuscrito.", "Unavailable": "No disponible", "Unchanged context": "Contexto sin cambios", diff --git a/src/web/locales/fr.json b/src/web/locales/fr.json index 42041948..63840050 100644 --- a/src/web/locales/fr.json +++ b/src/web/locales/fr.json @@ -1322,6 +1322,7 @@ "Source": "Source", "Source unavailable": "Source indisponible", "Sparkles": "Étincelles", + "Speed": "Vitesse", "Spelling": "Orthographe", "Spend": "Dépenses", "Split": "Scinder", @@ -1331,6 +1332,7 @@ "Stage {path}": "Indexer {path}", "Staged": "Indexées", "Staged changes": "Modifications indexées", + "Standard": "Standard", "Standard shortcuts": "Raccourcis standard", "Start syncing": "Démarrer la synchronisation", "Start task": "Démarrer la tâche", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Composition et autres remarques", "Typesetting with LaTeX, pass {n}…": "Composition avec LaTeX, passe {n}…", "Typos, word choice and small LaTeX fixes": "Coquilles, choix des mots et petites corrections LaTeX", + "Ultrafast": "Ultrarapide", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Les modifications et commentaires non acceptés seront perdus. Les modifications acceptées restent dans votre manuscrit.", "Unavailable": "Indisponible", "Unchanged context": "Contexte inchangé", diff --git a/src/web/locales/it.json b/src/web/locales/it.json index 5af4b845..cf011e1e 100644 --- a/src/web/locales/it.json +++ b/src/web/locales/it.json @@ -1322,6 +1322,7 @@ "Source": "Sorgente", "Source unavailable": "Sorgente non disponibile", "Sparkles": "Scintille", + "Speed": "Velocità", "Spelling": "Ortografia", "Spend": "Spesa", "Split": "Dividi", @@ -1331,6 +1332,7 @@ "Stage {path}": "Prepara {path}", "Staged": "Preparate", "Staged changes": "Modifiche preparate", + "Standard": "Standard", "Standard shortcuts": "Scorciatoie standard", "Start syncing": "Avvia sincronizzazione", "Start task": "Avvia attività", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Impaginazione e altre osservazioni", "Typesetting with LaTeX, pass {n}…": "Composizione con LaTeX, passaggio {n}…", "Typos, word choice and small LaTeX fixes": "Refusi, scelta delle parole e piccole correzioni LaTeX", + "Ultrafast": "Ultraveloce", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Le modifiche non accettate e i commenti andranno persi. Le modifiche accettate rimangono nel manoscritto.", "Unavailable": "Non disponibile", "Unchanged context": "Contesto invariato", diff --git a/src/web/locales/ja.json b/src/web/locales/ja.json index f9cb6e97..6130adef 100644 --- a/src/web/locales/ja.json +++ b/src/web/locales/ja.json @@ -1322,6 +1322,7 @@ "Source": "ソース", "Source unavailable": "ソースが見つかりません", "Sparkles": "きらめき", + "Speed": "速度", "Spelling": "スペルチェック", "Spend": "利用額", "Split": "分割", @@ -1331,6 +1332,7 @@ "Stage {path}": "{path} をステージ", "Staged": "ステージング済み", "Staged changes": "ステージング済みの変更", + "Standard": "標準", "Standard shortcuts": "標準ショートカット", "Start syncing": "同期を開始", "Start task": "タスクを開始", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "組版およびその他の指摘事項", "Typesetting with LaTeX, pass {n}…": "LaTeX で組版中 (パス {n})…", "Typos, word choice and small LaTeX fixes": "誤字、表現の選択、LaTeX の軽微な修正", + "Ultrafast": "超高速", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "未承認の編集とコメントは失われます。承認済みの変更は原稿に残ります。", "Unavailable": "利用不可", "Unchanged context": "変更のない前後の文脈", diff --git a/src/web/locales/ko.json b/src/web/locales/ko.json index 3a50bda0..38f8009d 100644 --- a/src/web/locales/ko.json +++ b/src/web/locales/ko.json @@ -1322,6 +1322,7 @@ "Source": "소스", "Source unavailable": "소스를 찾을 수 없음", "Sparkles": "반짝임", + "Speed": "속도", "Spelling": "맞춤법", "Spend": "지출", "Split": "분할", @@ -1331,6 +1332,7 @@ "Stage {path}": "{path} 스테이징", "Staged": "스테이징됨", "Staged changes": "스테이징된 변경 사항", + "Standard": "표준", "Standard shortcuts": "표준 단축키", "Start syncing": "동기화 시작", "Start task": "작업 시작", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "조판 및 기타 참고 사항", "Typesetting with LaTeX, pass {n}…": "LaTeX으로 조판 중, {n}회차…", "Typos, word choice and small LaTeX fixes": "오타, 어휘 선택 및 간단한 LaTeX 수정", + "Ultrafast": "초고속", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "수락하지 않은 수정 사항과 댓글은 사라집니다. 수락한 변경 사항은 원고에 유지됩니다.", "Unavailable": "사용 불가", "Unchanged context": "변경되지 않은 주변 내용", diff --git a/src/web/locales/pt.json b/src/web/locales/pt.json index e9d5daed..e7e86d19 100644 --- a/src/web/locales/pt.json +++ b/src/web/locales/pt.json @@ -1322,6 +1322,7 @@ "Source": "Código-fonte", "Source unavailable": "Fonte indisponível", "Sparkles": "Brilhos", + "Speed": "Velocidade", "Spelling": "Ortografia", "Spend": "Gasto", "Split": "Dividir", @@ -1331,6 +1332,7 @@ "Stage {path}": "Preparar {path}", "Staged": "Preparado", "Staged changes": "Alterações preparadas", + "Standard": "Padrão", "Standard shortcuts": "Atalhos padrão", "Start syncing": "Iniciar sincronização", "Start task": "Iniciar tarefa", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Composição tipográfica e outras observações", "Typesetting with LaTeX, pass {n}…": "Diagramando com LaTeX, passagem {n}…", "Typos, word choice and small LaTeX fixes": "Erros de digitação, escolha de palavras e pequenas correções de LaTeX", + "Ultrafast": "Ultrarrápido", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Edições e comentários não aceitos serão perdidos. As alterações aceitas permanecem no seu manuscrito.", "Unavailable": "Indisponível", "Unchanged context": "Contexto sem alterações", diff --git a/src/web/locales/sv.json b/src/web/locales/sv.json index a7402523..b3b87819 100644 --- a/src/web/locales/sv.json +++ b/src/web/locales/sv.json @@ -1322,6 +1322,7 @@ "Source": "Källkod", "Source unavailable": "Källan är inte tillgänglig", "Sparkles": "Gnistor", + "Speed": "Hastighet", "Spelling": "Stavning", "Spend": "Kostnad", "Split": "Delad", @@ -1331,6 +1332,7 @@ "Stage {path}": "Köa {path}", "Staged": "Förberedda", "Staged changes": "Förberedda ändringar", + "Standard": "Standard", "Standard shortcuts": "Standardgenvägar", "Start syncing": "Börja synkronisera", "Start task": "Starta uppgift", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "Typsättning och övriga anmärkningar", "Typesetting with LaTeX, pass {n}…": "Typsätter med LaTeX, omgång {n}…", "Typos, word choice and small LaTeX fixes": "Stavfel, ordval och mindre LaTeX-korrigeringar", + "Ultrafast": "Ultrasnabb", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "Oaccepterade redigeringar och kommentarer går förlorade. Accepterade ändringar blir kvar i ditt manuskript.", "Unavailable": "Inte tillgänglig", "Unchanged context": "Oförändrat sammanhang", diff --git a/src/web/locales/zh-Hant.json b/src/web/locales/zh-Hant.json index 3763ce9c..42017548 100644 --- a/src/web/locales/zh-Hant.json +++ b/src/web/locales/zh-Hant.json @@ -1322,6 +1322,7 @@ "Source": "原始碼", "Source unavailable": "原始碼無法使用", "Sparkles": "閃耀", + "Speed": "速度", "Spelling": "拼字", "Spend": "花費", "Split": "分割", @@ -1331,6 +1332,7 @@ "Stage {path}": "暫存 {path}", "Staged": "已暫存", "Staged changes": "已暫存的變更", + "Standard": "標準", "Standard shortcuts": "標準快捷鍵", "Start syncing": "開始同步", "Start task": "開始任務", @@ -1482,6 +1484,7 @@ "Typesetting and other remarks": "排版與其他備註", "Typesetting with LaTeX, pass {n}…": "正在使用 LaTeX 排版,第 {n} 輪…", "Typos, word choice and small LaTeX fixes": "錯別字、遣詞用字與小型 LaTeX 修正", + "Ultrafast": "極速", "Unaccepted edits and comments will be lost. Accepted changes stay in your manuscript.": "未接受的編輯與評論將會遺失。已接受的變更會保留在您的論文原稿中。", "Unavailable": "無法使用", "Unchanged context": "未修改的上下文", diff --git a/src/web/main.tsx b/src/web/main.tsx index 1d8aa7ee..868742a3 100644 --- a/src/web/main.tsx +++ b/src/web/main.tsx @@ -18,7 +18,7 @@ import { createPortal, flushSync } from 'react-dom'; import { readNotesInstructions, type NoteSummary } from '../notes.ts'; import { aiReviewSummary, isFeedbackPrompt } from '../conversation.ts'; import { ignorePattern } from '../commit.ts'; -import { AGENT_IDS, isAgentId, isTaskReviewNote, taskFinished } from '../shared.ts'; +import { modelServiceTier, AGENT_IDS, isAgentId, isTaskReviewNote, taskFinished } from '../shared.ts'; import type { TaskCommitReview, CompilerChoice, LatexInstallation, ZoteroStatus, AgentId, Annotation, AnnotationGroupEdit, AnnotationGroupState, AnnotationBatch, AnnotationBatchResult, NoteSection, PageReadingLayout, BuildRepairResult, MarkKind, Author, FeedbackSummary, GitDiff, GitFile, GitOverview, GitStatus, Manuscript, ManuscriptProblems, PendingRequest, Project, RuntimeStatus, Skill, Snapshot, Task, TimelineItem } from '../shared.ts'; import { SkillChip, SkillMenu, SkillPicker, matchSkills, skillName, skillQuery } from './skills.tsx'; import { reviewDraft, useReviewDraft, reviewNoteSummary, reviewSubmission } from './review-draft.ts'; @@ -1768,8 +1768,8 @@ function App() { const runtime = runtimes[id], models = runtime?.models || [], preferred = agentModels[id]; const chosen = models.length && !models.some(model => model.id === preferred) ? '' : preferred; const model = models.find(model => model.id === chosen) || defaultOfferedModel(runtime); - const pref = readModelPreferences(id, chosen, model) || { effort: isPlayground && id === 'codex' ? 'xhigh' : null, fast: false }; - const serviceTier = id === 'codex' ? (pref.fast ? model?.fastMode?.serviceTier || 'default' : 'default') : undefined; + const pref = readModelPreferences(id, chosen, model) || { effort: isPlayground && id === 'codex' ? 'xhigh' : null, serviceTier: 'default' }; + const serviceTier = id === 'codex' ? modelServiceTier(model, pref.serviceTier) : undefined; return { chosen, pref, agent: { agent: id, model: model?.id || chosen, effort: taskEffort(pref.effort, model), serviceTier } }; } const defaultSelection = modelSelection(defaultAgent); @@ -1790,7 +1790,7 @@ function App() { : runtimes[commitPreference.agent]?.supportsReadOnlyTasks === false ? undefined : commitPreference; const diagnosisAgent = readOnlyChoice(defaultSelection.agent); const conflictWriter = conflictPreference === 'conversation' ? conversationHelper : conflictPreference; - const remember = (change: Partial<{ effort: string; fast: boolean }>) => { + const remember = (change: Partial<{ effort: string; serviceTier: string }>) => { saveModelPreferences(agentChoice, agent.model, { ...pref, ...change }); }; // One choice in the picker sets both the agent and its model. @@ -1798,7 +1798,7 @@ function App() { setAgentChoice(id); browserStorage.setItem('papilot:agent', id); setAgentModels(current => ({ ...current, [id]: model })); browserStorage.setItem(`papilot:model:${id}`, model); }; - const agentOptions = (disabled: boolean) => ({ value: id, label: agentLabel(id), runtime: runtimes[id] }))} permissionMode={newSkill?.output !== 'annotations' ? effectivePermissions : undefined} permissions={newSkill?.output !== 'annotations' && savePermissionPreference(agentChoice, value)}/>} diff --git a/src/web/playground/data.ts b/src/web/playground/data.ts index 724b1ec9..5b35c8b6 100644 --- a/src/web/playground/data.ts +++ b/src/web/playground/data.ts @@ -1,5 +1,5 @@ import { regroupAnnotation, sameAnnotationGroup } from '../../note-groups.ts'; -import { ACTIVITY_RANGES, type ActivityDay, type ActivityRange, type ActivityReport, type Annotation, type AnnotationGroupEdit, type AnnotationBatch, type AnnotationBatchResult, type GitStatus, type Manuscript, type Snapshot, type Task, type TimelineItem, type AgentId, type Skill, type NoteSummary, type NoteResult, type NoteOptions } from '../../shared.ts'; +import { modelServiceTier, ACTIVITY_RANGES, type ActivityDay, type ActivityRange, type ActivityReport, type Annotation, type AnnotationGroupEdit, type AnnotationBatch, type AnnotationBatchResult, type GitStatus, type Manuscript, type Snapshot, type Task, type TimelineItem, type AgentId, type Skill, type NoteSummary, type NoteResult, type NoteOptions } from '../../shared.ts'; import type { ActionKind, Decision, PageState, RoundDetail } from '../../../engine/src/types.ts'; import plans from '../../../examples/playground-paper/edits.json'; import seededNotes from '../../../examples/playground-paper/preview/notes.json'; @@ -277,7 +277,7 @@ export function createPlaygroundData(storage: Store, version: string, pdfKey: st const input = body as { model: string; effort: string; serviceTier?: string }; const models = demoRuntimes[modelTask.agent as AgentId].models; const selected = models.find(model => input.model ? model.id === input.model : model.isDefault); - if (!selected || typeof input.effort !== 'string' || (input.effort && !selected.efforts.includes(input.effort)) || (input.serviceTier && input.serviceTier !== 'default' && input.serviceTier !== selected.fastMode?.serviceTier)) throw new Error('Invalid demo model settings.'); + if (!selected || typeof input.effort !== 'string' || (input.effort && !selected.efforts.includes(input.effort)) || (input.serviceTier && input.serviceTier !== modelServiceTier(selected, input.serviceTier))) throw new Error('Invalid demo model settings.'); local.taskSettings[modelTask.id] = { ...local.taskSettings[modelTask.id], model: selected.id, effort: input.effort || null, serviceTier: input.serviceTier || 'default' }; persist(); return task(modelTask, [reviewPlan, ...plans].indexOf(modelTask)); } diff --git a/src/web/playground/models.ts b/src/web/playground/models.ts index 4a91d8a5..2341752e 100644 --- a/src/web/playground/models.ts +++ b/src/web/playground/models.ts @@ -12,7 +12,7 @@ const catalog: Partial> = { model('gpt-6.1-sol', 'GPT-6.1 Sol', codexEfforts, 'high'), model('gpt-6.1-terra', 'GPT-6.1 Terra', codexEfforts, 'high'), model('gpt-6-luna', 'GPT-6 Luna', ['low', 'medium', 'high', 'xhigh', 'max'], 'medium'), - ].map(model => ({ ...model, fastMode: { serviceTier: 'priority', description: '' } })), + ].map(model => ({ ...model, serviceTiers: ['priority'] })), claude: [ model('fable', 'Fable', claudeEfforts, 'high', true), model('opus', 'Opus', claudeEfforts, 'high'), diff --git a/src/web/style.css b/src/web/style.css index fa0d6079..a9d95703 100644 --- a/src/web/style.css +++ b/src/web/style.css @@ -634,6 +634,14 @@ body.resizing iframe{pointer-events:none} .agent-fast input:checked{background:var(--accent)} .agent-fast input:checked::before{transform:translateX(12px);background:#fff} .agent-fast input:focus-visible{outline:1px solid var(--accent);outline-offset:2px} +.agent-speed{min-inline-size:0;margin:12px 0 0;padding:5px 6px 0;border:0;border-top:1px solid var(--line)} +.agent-speed legend{padding:0 5px 0 0;font-size:12px;font-weight:500} +.agent-speed small{display:block;color:var(--text-3);font-size:11px;line-height:1.4} +.agent-speed-options{display:flex;flex-wrap:wrap;gap:2px 12px;margin-top:3px} +.agent-speed-options input{margin:0;accent-color:var(--accent)} +.agent-speed-options input:focus-visible{outline:1px solid var(--accent);outline-offset:2px} +.agent-speed-options label{display:flex;align-items:center;gap:5px;min-block-size:28px;cursor:pointer;font-size:12px} +@media (pointer:coarse){.agent-speed-options label{min-block-size:48px}} /* Account usage is one quiet row; reset times and credits expand on demand. */ .usage{flex:none;min-width:0;font-size:11px;color:var(--text-3)} .usage details{min-width:0} diff --git a/src/web/task-model-picker.tsx b/src/web/task-model-picker.tsx index 26aa43a2..89127392 100644 --- a/src/web/task-model-picker.tsx +++ b/src/web/task-model-picker.tsx @@ -1,6 +1,6 @@ import { agentLabel, agentOff, canReviewWith } from './agent-choice.ts'; import { type ReactNode, useEffect, useRef, useState } from 'react'; -import { AGENT_IDS, type AgentId, type RuntimeStatus, type Task } from '../shared.ts'; +import { AGENT_IDS, modelServiceTier, type AgentId, type RuntimeStatus, type Task } from '../shared.ts'; import { AgentPicker } from './agent-picker.tsx'; import { t } from './i18n.ts'; import type { RefreshUsage } from './usage.tsx'; @@ -32,7 +32,7 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin const agent = task.agent || 'codex'; function remember(settings: Settings) { const model = settings.model || runtime?.models.find(model => model.isDefault)?.id || ''; - saveModelPreferences(agent, model, { effort: settings.effort || '', fast: Boolean(settings.serviceTier && settings.serviceTier !== 'default') }); + saveModelPreferences(agent, model, { effort: settings.effort || '', serviceTier: settings.serviceTier || 'default' }); } function modelSettings(id: string | null, previous: Settings): Settings { if (previous.model === id) return previous; @@ -40,7 +40,7 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin const preference = readModelPreferences(agent, id || '', model); const effort = preference ? taskEffort(preference.effort, model) : previous.effort; return { model: id, effort: model?.efforts.includes(effort || '') ? effort : null, - serviceTier: (preference ? preference.fast : previous.serviceTier === model?.fastMode?.serviceTier) && model?.fastMode ? model.fastMode.serviceTier : 'default' }; + serviceTier: modelServiceTier(model, preference?.serviceTier ?? previous.serviceTier) }; } function change(update: (previous: Settings) => Settings) { if (disabled || switchPending.current) return; @@ -51,7 +51,9 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin try { // Resolve model switches after preceding saves, including rapid A/B/A. const next = update(saved.current); - const result = await save({ model: next.model || '', effort: next.effort || '', ...(agent === 'codex' ? { serviceTier: next.serviceTier || 'default' } : {}) }); + const model = runtime?.models.find(model => next.model ? model.id === next.model : model.isDefault); + const serviceTier = model ? modelServiceTier(model, next.serviceTier) : next.serviceTier || 'default'; + const result = await save({ model: next.model || '', effort: next.effort || '', ...(agent === 'codex' ? { serviceTier } : {}) }); remember(saved.current); saved.current = settingsOf(result); remember(saved.current); } catch (error) { reportError(error); } @@ -77,7 +79,7 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin const runtime = runtimes[nextAgent], model = runtime?.models.find(model => id ? model.id === id : model.isDefault); const preference = readModelPreferences(nextAgent, id, model); await switchAgent({ agent: nextAgent, model: id, effort: preference ? taskEffort(preference.effort, model) : '', - ...(nextAgent === 'codex' ? { serviceTier: preference?.fast && model?.fastMode ? model.fastMode.serviceTier : 'default' } : {}), + ...(nextAgent === 'codex' ? { serviceTier: modelServiceTier(model, preference?.serviceTier) } : {}), permissions: task.mode === 'review' ? 'workspace' : readPermissionPreference(nextAgent, runtime), stop: true }); } catch (error) { reportError(error); } @@ -96,11 +98,11 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin return <> { - const id = current.current.model, model = runtime?.models.find(model => id ? model.id === id : model.isDefault); - change(previous => ({ ...modelSettings(id, previous), ...(patch.effort !== undefined ? { effort: patch.effort || null } : {}), ...(patch.fast !== undefined ? { serviceTier: patch.fast ? model?.fastMode?.serviceTier : 'default' } : {}) })); + const id = current.current.model; + change(previous => ({ ...modelSettings(id, previous), ...(patch.effort !== undefined ? { effort: patch.effort || null } : {}), ...(patch.serviceTier !== undefined ? { serviceTier: patch.serviceTier } : {}) })); }}/>{switching && }; } diff --git a/src/web/zh-CN.ts b/src/web/zh-CN.ts index 43264001..1cfbe6c3 100644 --- a/src/web/zh-CN.ts +++ b/src/web/zh-CN.ts @@ -369,7 +369,7 @@ export const zhCN: Record = { 'Show note {n}: {comment}': '查看批注 {n}:{comment}', 'Note {n}': '批注 {n}', 'No tasks yet': '暂无任务', 'No matching skills': '没有匹配的技能', 'LaTeX Git repository · Requires a commit and latexmk': 'LaTeX Git 仓库 · 需有提交记录并安装 latexmk', '{agent} is unavailable': '{agent} 不可用', 'Connection details': '连接详情', - 'Faster, higher usage': '更快,用量更高', + 'Faster, higher usage': '更快,用量更高', 'Speed': '速度', 'Standard': '标准', 'Ultrafast': '极速', '{agent} was not found on this computer. Install or set it up, then select Reconnect.': '本机未找到 {agent}。安装或配置后点“重新连接”。', 'Search models': '搜索模型', 'Models': '模型', 'Recent': '最近使用', 'Default': '默认', 'No models match “{query}”': '没有匹配“{query}”的模型', 'Wait for the PDF to compile.': '请等待 PDF 编译完成。', 'Fit width': '适合宽度', 'Fit page': '适合页面', 'What should change here?': '这里应该怎么改?', 'Add note': '添加批注', 'PDF controls': 'PDF 控件', 'Previous page': '上一页', 'Page number': '页码', 'Next page': '下一页', diff --git a/tests/agent-preferences.test.ts b/tests/agent-preferences.test.ts index a99864e8..cd829e88 100644 --- a/tests/agent-preferences.test.ts +++ b/tests/agent-preferences.test.ts @@ -11,12 +11,12 @@ const model: AgentModel = { id: 'deep', name: 'Deep', isDefault: true, efforts: test('model preferences preserve explicit defaults and isolate agent/model identities', () => { const store = storage(); - saveModelPreferences('codex', 'deep', { effort: 'xhigh', fast: true }, store); - saveModelPreferences('codex', 'fast', { effort: 'low', fast: false }, store); - saveModelPreferences('claude', 'deep', { effort: '', fast: false }, store); - assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: 'xhigh', fast: true }); - assert.deepEqual(readModelPreferences('codex', 'fast', undefined, store), { effort: 'low', fast: false }); - assert.deepEqual(readModelPreferences('claude', 'deep', model, store), { effort: '', fast: false }); + saveModelPreferences('codex', 'deep', { effort: 'xhigh', serviceTier: 'ultrafast' }, store); + saveModelPreferences('codex', 'fast', { effort: 'low', serviceTier: 'default' }, store); + saveModelPreferences('claude', 'deep', { effort: '', serviceTier: 'default' }, store); + assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: 'xhigh', serviceTier: 'ultrafast' }); + assert.deepEqual(readModelPreferences('codex', 'fast', undefined, store), { effort: 'low', serviceTier: 'default' }); + assert.deepEqual(readModelPreferences('claude', 'deep', model, store), { effort: '', serviceTier: 'default' }); assert.equal(readModelPreferences('codex', 'unknown', undefined, store), null); store.setItem('papilot:model-preferences:["codex","deep"]', '{broken'); assert.equal(readModelPreferences('codex', 'deep', model, store), null); @@ -29,11 +29,12 @@ test('legacy choices migrate once to the selected model or resolved host default store.setItem('papilot:effort:codex', ''); store.setItem('papilot:fast:codex', 'true'); migrateAgentPreferences(store); - assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: '', fast: true }); + assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: '', serviceTier: 'priority' }); + assert.deepEqual(readModelPreferences('codex', 'deep', { ...model, serviceTiers: ['fast', 'ultrafast'] }, store), { effort: '', serviceTier: 'fast' }); assert.equal(readModelPreferences('codex', 'fast', { ...model, id: 'fast', isDefault: false }, store), null); - saveModelPreferences('codex', 'deep', { effort: 'low', fast: false }, store); + saveModelPreferences('codex', 'deep', { effort: 'low', serviceTier: 'default' }, store); migrateAgentPreferences(store); - assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: 'low', fast: false }); + assert.deepEqual(readModelPreferences('codex', 'deep', model, store), { effort: 'low', serviceTier: 'default' }); } }); diff --git a/tests/playground.test.ts b/tests/playground.test.ts index c6085bf0..5ffeca7c 100644 --- a/tests/playground.test.ts +++ b/tests/playground.test.ts @@ -74,7 +74,7 @@ test('the demo offers every supported agent and persists model controls without assert.equal(astra.id, 'gpt-6-astra'); assert.equal(astra.defaultEffort, 'xhigh'); assert.ok(astra.efforts.includes('ultra')); - assert.equal(astra.fastMode?.serviceTier, 'priority'); + assert.deepEqual(astra.serviceTiers, ['priority']); const route = '/tasks/example-clarity/model'; const permissions = '/tasks/example-clarity/permissions'; await api(permissions, { permissions: 'full' }); diff --git a/tests/workspace.test.ts b/tests/workspace.test.ts index 3564f027..7a3d51a6 100644 --- a/tests/workspace.test.ts +++ b/tests/workspace.test.ts @@ -305,7 +305,7 @@ function identifiedTurn(run: Run, status = 'inProgress') { } const taskModels = [ - { id: 'deep', name: 'Deep', isDefault: true, efforts: ['low', 'high', 'xhigh'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: '' } }, + { id: 'deep', name: 'Deep', isDefault: true, efforts: ['low', 'high', 'xhigh'], defaultEffort: 'high', serviceTiers: ['priority'] }, { id: 'small', name: 'Small', isDefault: false, efforts: ['low', 'high'], defaultEffort: 'low' }, ]; @@ -421,7 +421,7 @@ test('task model settings persist, validate capabilities and clear incompatible assert.equal(f.codex.calls.length, 0, 'changing settings does not interrupt an active turn'); assert.throws(() => f.workspace.updateTaskModel(f.task.id, { model: 'other-agent-model' }), /available model/); assert.throws(() => f.workspace.updateTaskModel(f.task.id, { effort: 'xhigh' }), /reasoning effort/); - assert.throws(() => f.workspace.updateTaskModel(f.task.id, { serviceTier: 'priority' }), /Fast mode/); + assert.throws(() => f.workspace.updateTaskModel(f.task.id, { serviceTier: 'priority' }), /This speed is not available/); f.workspace.updateTaskModel(f.task.id, { effort: 'high' }); assert.equal(f.workspace.updateTaskModel(f.task.id, { effort: '' }).effort, null); f.store.updateTask(f.task.id, { status: 'deleting' }); @@ -1936,34 +1936,38 @@ test('account usage keeps the limit windows, plan and credits Codex reports', () assert.equal(accountUsage(undefined), null); }); -test('Fast mode uses the catalog tier and preserves older catalogs without inventing support', () => { - assert.deepEqual(agentModel({ id: 'fast', serviceTiers: [{ id: 'priority', name: 'Fast', description: '2x speed' }] }).fastMode, { serviceTier: 'priority', description: '2x speed' }); - assert.deepEqual(agentModel({ id: 'older', additionalSpeedTiers: ['fast'] }).fastMode, { serviceTier: 'priority', description: '' }); - assert.equal(agentModel({ id: 'standard', serviceTiers: [], additionalSpeedTiers: ['fast'] }).fastMode, undefined); - assert.equal(agentModel({ id: 'plain' }).fastMode, undefined); +test('Codex speeds come from the model catalog, with compatibility for older catalogs', () => { + const tiers = [{ id: 'priority', name: 'Fast' }, { id: 'ultrafast', name: 'Ultrafast' }, { id: 'flex', name: 'Flex' }]; + assert.deepEqual(agentModel({ id: 'sol', serviceTiers: tiers }).serviceTiers, ['priority', 'ultrafast']); + assert.deepEqual(agentModel({ id: 'other', serviceTiers: [{ id: 'fast', name: 'Fast' }] }).serviceTiers, ['fast']); + assert.deepEqual(agentModel({ id: 'older', additionalSpeedTiers: ['fast', 'ultrafast'] }).serviceTiers, ['priority', 'ultrafast']); + assert.equal(agentModel({ id: 'standard', serviceTiers: [], additionalSpeedTiers: ['fast', 'ultrafast'] }).serviceTiers, undefined); + assert.equal(agentModel({ id: 'plain' }).serviceTiers, undefined); }); -test('tasks persist the chosen service tier, and reject unsupported Fast mode before creating a worktree', async () => { +test('tasks persist the chosen service tier, and reject unsupported speeds before creating a worktree', async () => { const f = fixture(async (_method, route) => route === '/api/tasks' ? { worktree: '/unused' } : summary); try { - f.workspace.runtime.models = [agentModel({ id: 'model', isDefault: true, serviceTiers: [{ id: 'priority', name: 'Fast' }] })]; + f.workspace.runtime.models = [agentModel({ id: 'model', isDefault: true, serviceTiers: [{ id: 'priority', name: 'Fast' }, { id: 'ultrafast', name: 'Ultrafast' }] })]; const input = { id: 'fast-task-test-01', projectId: 'paper', title: 'Revise', instructions: 'Revise.', serviceTier: 'priority' }; const created = await f.workspace.createTask(input); assert.equal(f.store.task(created.id).serviceTier, 'priority'); const retry = await f.workspace.createTask({ ...input, serviceTier: 'default' }); assert.equal(retry.serviceTier, 'priority', 'a retry cannot change an existing task'); const before = f.calls.length; - await assert.rejects(f.workspace.createTask({ ...input, id: 'fast-task-test-02', model: 'unsupported' }), /Fast mode is not available/); + await assert.rejects(f.workspace.createTask({ ...input, id: 'fast-task-test-02', model: 'unsupported' }), /This speed is not available/); await assert.rejects(f.workspace.createTask({ ...input, id: 'fast-task-test-03', agent: 'claude' }), /only available for Codex/); - await assert.rejects(f.workspace.createTask({ ...input, id: 'fast-task-test-04', serviceTier: 'unknown' }), /Fast mode is not available/); + await assert.rejects(f.workspace.createTask({ ...input, id: 'fast-task-test-04', serviceTier: 'unknown' }), /This speed is not available/); assert.equal(f.calls.length, before); + const ultrafast = await f.workspace.createTask({ ...input, id: 'fast-task-test-06', serviceTier: 'ultrafast' }); + assert.equal(f.store.task(ultrafast.id).serviceTier, 'ultrafast'); const standard = await f.workspace.createTask({ ...input, id: 'fast-task-test-05', serviceTier: 'default' }); assert.equal(standard.serviceTier, 'default'); } finally { f.close(); } }); -test('Codex receives the saved Fast or explicit standard tier without changing reasoning', async () => { - for (const serviceTier of ['priority', 'default', undefined]) { +test('Codex receives the saved speed without changing reasoning', async () => { + for (const serviceTier of ['priority', 'ultrafast', 'default', undefined]) { const f = fixture(); try { f.codex.ready = true; @@ -1978,6 +1982,20 @@ test('Codex receives the saved Fast or explicit standard tier without changing r } }); +test('a task uses Standard when Codex stops advertising its saved speed', async () => { + const f = fixture(); + try { + f.codex.ready = true; + f.workspace.runtime.models = taskModels; + f.store.updateTask(f.task.id, { model: 'deep', serviceTier: 'ultrafast' }); + await f.workspace.enqueue(f.task.id, 'Next revision.', 'next', false); + await tick(); + assert.equal(f.codex.calls.find(call => call.method === 'turn/start')?.params.serviceTier, 'default'); + assert.equal(f.store.task(f.task.id).serviceTier, 'ultrafast', 'a catalog refresh does not overwrite the saved speed'); + assert.equal(f.workspace.updateTaskModel(f.task.id, { effort: 'low' }).serviceTier, 'default'); + } finally { f.close(); } +}); + test('a question without an "Other" choice only accepts one of its options', async () => { const claude = new FakeCodex(); const f = fixture(undefined, { claude }); @@ -2230,7 +2248,7 @@ test('commit messages honor model, effort and Fast mode and cache each selection try { f.codex.ready = true; f.workspace.runtimes.codex.models = [ - { id: 'full', name: 'Full', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: '' } }, + { id: 'full', name: 'Full', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high', serviceTiers: ['priority'] }, { id: 'small', name: 'Small', isDefault: false, efforts: ['low', 'high'], defaultEffort: 'low' }, ]; const calls: unknown[] = []; @@ -2244,7 +2262,7 @@ test('commit messages honor model, effort and Fast mode and cache each selection assert.deepEqual(calls, [['codex', 'full', 'high', undefined], ['codex', 'small', 'high', undefined], ['codex', 'small', 'low', undefined], ['codex', 'full', 'high', 'priority']]); await assert.rejects(write({ model: 'missing' }), /Choose an available model/); await assert.rejects(write({ model: 'small', effort: 'ultra' }), /does not support that reasoning effort/); - await assert.rejects(write({ model: 'small', serviceTier: 'priority' }), /Fast mode is not available/); + await assert.rejects(write({ model: 'small', serviceTier: 'priority' }), /This speed is not available/); assert.equal(calls.length, 4); } finally { f.close(); } }); @@ -2253,7 +2271,7 @@ test('commit-message model settings reach the actual helper turn', async () => { const f = fixture(); try { f.codex.ready = true; - f.workspace.runtimes.codex.models = [{ id: 'chosen', name: 'Chosen', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'low', fastMode: { serviceTier: 'priority', description: '' } }]; + f.workspace.runtimes.codex.models = [{ id: 'chosen', name: 'Chosen', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'low', serviceTiers: ['priority', 'ultrafast'] }]; (f.workspace as any).taskCommitChanges = async () => ({ files: [{ path: 'main.tex', status: 'M' }], patch: '-Old\n+New', recent: [] }); f.codex.handler = async method => { if (method === 'thread/start') return { thread: { id: 'chosen-helper' } }; @@ -2264,10 +2282,10 @@ test('commit-message model settings reach the actual helper turn', async () => { }); return { turn: { id: 'helper-turn' } }; }; - await f.workspace.commitMessage(f.task.projectId, ['main.tex'], { agent: 'codex', taskId: f.task.id, model: 'chosen', effort: 'high', serviceTier: 'priority' }); + await f.workspace.commitMessage(f.task.projectId, ['main.tex'], { agent: 'codex', taskId: f.task.id, model: 'chosen', effort: 'high', serviceTier: 'ultrafast' }); assert.equal(f.codex.calls.find(call => call.method === 'thread/start')!.params.model, 'chosen'); const turn = f.codex.calls.find(call => call.method === 'turn/start')!.params; - assert.equal(turn.effort, 'high'); assert.equal(turn.serviceTier, 'priority'); + assert.equal(turn.effort, 'high'); assert.equal(turn.serviceTier, 'ultrafast'); } finally { f.close(); } }); @@ -2664,7 +2682,7 @@ test('an agent resolves a merge in the manuscript checkout, and review writes wa f.store.saveProject({ id: f.task.projectId, name: 'Paper', path: root, createdAt: 1 }); await assert.rejects(f.workspace.reviewWrite(f.task.id, true, async () => undefined), /Finish or abort the merge/); f.codex.ready = true; - f.workspace.runtimes.codex.models = [{ id: 'deep', name: 'Deep', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high', fastMode: { serviceTier: 'priority', description: '' } }]; + f.workspace.runtimes.codex.models = [{ id: 'deep', name: 'Deep', isDefault: true, efforts: ['low', 'high'], defaultEffort: 'high', serviceTiers: ['priority'] }]; f.codex.handler = async method => { if (method === 'thread/start') return { thread: { id: 'merge-thread' } }; fs.writeFileSync(path.join(root, 'main.tex'), 'My opening, as reworded.\n'); @@ -2679,7 +2697,7 @@ test('an agent resolves a merge in the manuscript checkout, and review writes wa await assert.rejects(resolve({ agent: 'claude' }), /selected conflict-resolution agent is unavailable/); await assert.rejects(resolve({ agent: 'codex', model: 'unknown' }), /available model/); await assert.rejects(resolve({ agent: 'codex', model: 'deep', effort: 'medium' }), /does not support that reasoning effort/); - await assert.rejects(resolve({ agent: 'codex', model: 'deep', serviceTier: 'unknown' }), /Fast mode is not available/); + await assert.rejects(resolve({ agent: 'codex', model: 'deep', serviceTier: 'unknown' }), /This speed is not available/); assert.ok(!f.codex.calls.some(call => call.method === 'thread/start')); const result = await resolve({ agent: 'codex', model: 'deep', effort: 'low', serviceTier: 'priority' }); assert.equal(run(root, 'rev-parse', 'HEAD'), before, 'The author still commits the merge'); @@ -3990,7 +4008,7 @@ test('switching agents validates the destination settings and leaves the task un const f = switchFixture(); try { const original = f.store.task(f.task.id); - for (const change of [{ model: 'codex-model' }, { effort: 'xhigh' }, { serviceTier: 'priority' }, { permissions: 'unsupported' }, { permissions: 123 }]) await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...f.choice, ...change }), /available model|reasoning effort|Fast mode|permissions/); + for (const change of [{ model: 'codex-model' }, { effort: 'xhigh' }, { serviceTier: 'priority' }, { permissions: 'unsupported' }, { permissions: 123 }]) await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...f.choice, ...change }), /available model|reasoning effort|This speed is not available|permissions/); f.workspace.runtimes.claude.authenticated = false; await assert.rejects(f.workspace.switchTaskAgent(f.task.id, f.choice), /Connect and sign in to the destination agent/); await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...f.choice, agent: 'collaboration' }), /Enable collaboration mode/); @@ -4032,7 +4050,7 @@ test('an editing task switches to ZCode with its configured default model', asyn const choice = { agent: 'zcode' as const, model: '' }; await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...choice, model: 'unknown' }), /available model/); await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...choice, effort: 'high' }), /reasoning effort/); - await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...choice, serviceTier: 'priority' }), /Fast mode/); + await assert.rejects(f.workspace.switchTaskAgent(f.task.id, { ...choice, serviceTier: 'priority' }), /This speed is not available/); const switched = await f.workspace.switchTaskAgent(f.task.id, choice); assert.equal(switched.agent, 'zcode'); assert.equal(switched.model, null); From 34b1f66aa29b502fe3eeeccde59bd40a06c13ddd Mon Sep 17 00:00:00 2001 From: Chen Cui Date: Fri, 27 Nov 2026 10:28:29 +0800 Subject: [PATCH 2/5] Show Codex speeds as a segmented control Show one bolt for Fast and two for Ultrafast on the choices and the model button. Preserve the radio group and its keyboard interaction, with sized touch targets and a visible selected state. Modern Web Guidance: forms and accessibility for native radio semantics and focus, browser-ui-theming for applying the app palette to native controls, and form-factor-adaptation for full-size touch areas and wrapping labels. --- CHANGELOG.md | 2 +- docs/guide.md | 2 +- scripts/check-task-model.mjs | 3 +++ src/web/agent-picker.tsx | 18 +++++++++++++----- src/web/style.css | 16 ++++++++++------ 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64015bff..9512d94d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to Papilot, newest first. The format follows [Keep a Changelog]( ### Added -- Choose **Ultrafast** in the Codex model picker when your account and model offer it. Papilot remembers the selected speed per model. +- Choose **Ultrafast** in the Codex model picker when your account and model offer it. Papilot remembers the selected speed per model and marks Fast with one lightning bolt and Ultrafast with two. - Choose **ZCode** for manuscript tasks. Papilot uses your local ZCode CLI and its default model, streams replies and tool activity, and resumes the same conversation on follow-up turns. ([#338](https://github.com/PapilotAI/papilot/issues/338)) - Use a third-party OpenAI-compatible Chat Completions API with **Settings → Runtime → Agents → Papilot Writer → Custom API**. Save the provider's base URL, model ID and API key, then choose that model for a task. ([#338](https://github.com/PapilotAI/papilot/issues/338)) - Set the LaTeX source editor's font size on its own with **Editor font size** in **Settings → Appearance** (10–24 px). The PDF and the rest of the interface keep their size, and the choice is remembered in this browser. ([#345](https://github.com/PapilotAI/papilot/issues/345)) diff --git a/docs/guide.md b/docs/guide.md index 4cf2dfe8..8aacf7a6 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -74,7 +74,7 @@ To use a third-party OpenAI-compatible model, open **Settings → Runtime → Ag The model menu below the chat lists models from every configured agent. Choosing another model from the current agent applies it to the next turn. Choosing a model from another agent moves the task to that agent: the conversation, proposed changes, review decisions and unsent drafts stay in the task. The next turn starts a session of the new agent, and Papilot gives it the conversation so far: each request and the replies to it, oldest first. Tool activity is left out, because the task's files already contain the earlier edits. If the task is working, its turn stops first. Instructions already queued behind that turn go to the new agent; your unsent draft stays in the composer. Tasks that Papilot 0.13 and earlier restarted on another agent still link to the task they replaced. -Each task runs on one agent and model, chosen from the model menu below the prompt. The menu lists every available agent's models, grouped by agent with your recent choices first; type to search all of them, or use the arrow keys and Enter. Reasoning effort and speed settings for the chosen model sit below the list. When your Codex account and model offer Ultrafast, choose it under **Speed**. Models that only offer Fast have a **Fast mode** switch. Use the arrow keys on a focused reasoning slider to change its level. Papilot remembers the agent, and each agent's model and reasoning effort, for the next task. Papilot looks for every agent when it starts and whenever you select **Reconnect**, and offers only the ones it finds on this host: an installed CLI, or the API key an SDK-based agent needs. The `papilot` command always offers Codex, because it installs it; the desktop app offers it when it finds one. An agent that is found but not signed in is listed as unavailable and says why. **Settings → Runtime → Agents** shows every supported agent and its live availability, including agents that are not set up. Select an agent card to see its account, model names, setup instructions, installation checks, and usage limits when the agent reports them. Model names appear as compact labels, with longer catalogs expandable. When setup is not detected, the card explains the server-side detection result, offers steps for that adapter, and provides Reconnect to refresh availability. Changes to environment variables require restarting Papilot; a different terminal or desktop-app login may not configure the running server. Details open within Settings; quotas are hidden while the connection is unavailable. The **LaTeX** page automatically identifies the active distribution (such as MacTeX, TeX Live, or MiKTeX), version, and installation location on the host. +Each task runs on one agent and model, chosen from the model menu below the prompt. The menu lists every available agent's models, grouped by agent with your recent choices first; type to search all of them, or use the arrow keys and Enter. Reasoning effort and speed settings for the chosen model sit below the list. When your Codex account and model offer Ultrafast, choose it under **Speed**. One lightning bolt marks Fast and two mark Ultrafast in the picker and its button. Models that only offer Fast have a **Fast mode** switch. Use the arrow keys on a focused reasoning slider to change its level. Papilot remembers the agent, and each agent's model and reasoning effort, for the next task. Papilot looks for every agent when it starts and whenever you select **Reconnect**, and offers only the ones it finds on this host: an installed CLI, or the API key an SDK-based agent needs. The `papilot` command always offers Codex, because it installs it; the desktop app offers it when it finds one. An agent that is found but not signed in is listed as unavailable and says why. **Settings → Runtime → Agents** shows every supported agent and its live availability, including agents that are not set up. Select an agent card to see its account, model names, setup instructions, installation checks, and usage limits when the agent reports them. Model names appear as compact labels, with longer catalogs expandable. When setup is not detected, the card explains the server-side detection result, offers steps for that adapter, and provides Reconnect to refresh availability. Changes to environment variables require restarting Papilot; a different terminal or desktop-app login may not configure the running server. Details open within Settings; quotas are hidden while the connection is unavailable. The **LaTeX** page automatically identifies the active distribution (such as MacTeX, TeX Live, or MiKTeX), version, and installation location on the host. **Settings → General → Quick model** chooses the model for quick background jobs: checking citations in the Library and naming tasks. **Automatic** lets each job use the small model of the agent it would use anyway, such as a task's own agent for its title. A model you choose, such as DeepSeek V4.1 Flash UltraFast from DeepSeek Harness, does all of them; it is saved on the Papilot host, where the jobs run, and while its agent is signed out or off the jobs fall back to **Automatic**. diff --git a/scripts/check-task-model.mjs b/scripts/check-task-model.mjs index fd4f90c9..10f6d17d 100644 --- a/scripts/check-task-model.mjs +++ b/scripts/check-task-model.mjs @@ -75,8 +75,11 @@ try { const taskSpeed = taskModelMenu.getByRole('group', { name: 'Speed', exact: true }); await taskSpeed.getByRole('radio', { name: 'Fast', exact: true }).check(); await expect.poll(() => task.serviceTier).toBe('priority'); + await expect(taskSettings.locator('.agent-speed-bolts svg')).toHaveCount(1); await taskSpeed.getByRole('radio', { name: 'Fast', exact: true }).press('ArrowRight'); await expect.poll(() => task.serviceTier).toBe('ultrafast'); + await expect(taskSpeed.getByRole('radio', { name: 'Ultrafast', exact: true })).toBeFocused(); + await expect(taskSettings.locator('.agent-speed-bolts svg')).toHaveCount(2); await taskModelMenu.getByRole('button', { name: 'Model default', exact: true }).click(); await expect.poll(() => task.effort).toBe(null); await expect(taskSettings).toContainText('High'); diff --git a/src/web/agent-picker.tsx b/src/web/agent-picker.tsx index 42fc5d68..03017191 100644 --- a/src/web/agent-picker.tsx +++ b/src/web/agent-picker.tsx @@ -9,9 +9,16 @@ import { permissionText } from './task-permissions.tsx'; import { PickerUsage, type RefreshUsage } from './usage.tsx'; import { shownModels } from './agent-choice.ts'; +function SpeedBolts({ tier, size }: { tier: string; size: number }) { + return ; +} + // The picker and an existing conversation use the same compact model label. -export function ModelLabel({ model, effort, fast }: { model: string; effort?: string | null; fast?: boolean }) { - return {model}{effort && {effortName(effort)}}{fast && }; +function ModelLabel({ model, effort, speed }: { model: string; effort?: string | null; speed?: string }) { + return {model}{effort && {effortName(effort)}}{speed && }; } export function AgentConnectionNotice({ name, runtime, reconnecting, onReconnect }: { name: string; runtime?: RuntimeStatus; reconnecting: boolean; onReconnect: () => void }) { @@ -199,7 +206,7 @@ export function AgentPicker({ label, agents, agent, model, effort, serviceTier, onKeyDown={event => { if (event.key === 'ArrowDown') { event.preventDefault(); show(); } }}> {noAgent ? {t('No agent')} : <>{!permission && modelName !== agentName && {agentName}} - + {permission && {permissionText(permission.label)}} {disconnected && }} @@ -235,9 +242,10 @@ export function AgentPicker({ label, agents, agent, model, effort, serviceTier, {t('Speed')} {t('Faster, higher usage')}
- {['default', ...tiers].map(tier =>
: tiers?.length ?
; } diff --git a/src/web/main.tsx b/src/web/main.tsx index 868742a3..89b2099f 100644 --- a/src/web/main.tsx +++ b/src/web/main.tsx @@ -1,7 +1,7 @@ import '../../engine/src/web/legacy-storage.ts'; import { TaskDocument } from './task-document.tsx'; import { requestApi, requestState } from './api.ts'; -import { agentLabel, agentsSettled, canReviewWith, chosenAgent, defaultOfferedModel, noAgent, offeredAgents } from './agent-choice.ts'; +import { agentLabel, agentsSettled, canReviewWith, chosenAgent, defaultOfferedModel, noAgent, offeredAgents, shownModels } from './agent-choice.ts'; import { isPlayground, pdfAsset, wordAsset, requestPlaygroundDownload } from './playground-mode.ts'; import { annotationGroupState, canonicalGroup, groupsWithoutInstructions, noteGroups, type NoteGroup } from '../note-groups.ts'; import { NOTE_SORT_MODES, groupNoteEntries, isNoteSortMode, sortNoteEntries, type NoteSortMode } from '../note-sort.ts'; @@ -18,7 +18,7 @@ import { createPortal, flushSync } from 'react-dom'; import { readNotesInstructions, type NoteSummary } from '../notes.ts'; import { aiReviewSummary, isFeedbackPrompt } from '../conversation.ts'; import { ignorePattern } from '../commit.ts'; -import { modelServiceTier, AGENT_IDS, isAgentId, isTaskReviewNote, taskFinished } from '../shared.ts'; +import { effectiveServiceTier, modelServiceTier, AGENT_IDS, isAgentId, isTaskReviewNote, taskFinished } from '../shared.ts'; import type { TaskCommitReview, CompilerChoice, LatexInstallation, ZoteroStatus, AgentId, Annotation, AnnotationGroupEdit, AnnotationGroupState, AnnotationBatch, AnnotationBatchResult, NoteSection, PageReadingLayout, BuildRepairResult, MarkKind, Author, FeedbackSummary, GitDiff, GitFile, GitOverview, GitStatus, Manuscript, ManuscriptProblems, PendingRequest, Project, RuntimeStatus, Skill, Snapshot, Task, TimelineItem } from '../shared.ts'; import { SkillChip, SkillMenu, SkillPicker, matchSkills, skillName, skillQuery } from './skills.tsx'; import { reviewDraft, useReviewDraft, reviewNoteSummary, reviewSubmission } from './review-draft.ts'; @@ -1782,14 +1782,22 @@ function App() { const ready = readOnlyAgents.find(id => runtimes[id]?.connected && runtimes[id]?.authenticated); if (ready) return { agent: ready, model: '', effort: '' }; } - const conversationHelper: CommitMessageChoice = commitContext ? { + function effectiveGitChoice(choice: CommitMessageChoice): CommitMessageChoice { + if (choice.agent !== 'codex' || !choice.serviceTier) return choice; + const runtime = runtimes.codex; + const model = choice.model ? runtime?.models.find(model => model.id === choice.model) + : defaultOfferedModel(runtime) ?? shownModels(runtime)[0]; + const serviceTier = effectiveServiceTier(model, choice.serviceTier); + return serviceTier === choice.serviceTier ? choice : { ...choice, serviceTier }; + } + const conversationHelper = commitContext ? effectiveGitChoice({ agent: commitContext.agent || 'codex', model: commitContext.model || '', effort: commitContext.effort || '', ...(commitContext.serviceTier ? { serviceTier: commitContext.serviceTier } : {}), - } : defaultSelection.agent; + }) : defaultSelection.agent; const commitWriter = commitPreference === 'conversation' ? readOnlyChoice(conversationHelper) - : runtimes[commitPreference.agent]?.supportsReadOnlyTasks === false ? undefined : commitPreference; + : runtimes[commitPreference.agent]?.supportsReadOnlyTasks === false ? undefined : effectiveGitChoice(commitPreference); const diagnosisAgent = readOnlyChoice(defaultSelection.agent); - const conflictWriter = conflictPreference === 'conversation' ? conversationHelper : conflictPreference; + const conflictWriter = conflictPreference === 'conversation' ? conversationHelper : effectiveGitChoice(conflictPreference); const remember = (change: Partial<{ effort: string; serviceTier: string }>) => { saveModelPreferences(agentChoice, agent.model, { ...pref, ...change }); }; @@ -2456,7 +2464,7 @@ function App() { } const saveTask = async (mode: 'workspace' | 'commit', message?: string, confirmation?: string) => { if (!task) return; - // An overlap with the manuscript is merged by the chosen conflict-resolution agent. + // A queued merge suggestion resolves the saved choice when its agent starts. const result = await api<{ git?: GitStatus; commitReview?: TaskCommitReview }>(`/tasks/${task.id}/apply`, { mode, message, confirmation, keepCurrent: mergeWaiting && merging?.ready, ...(conflictPreference === 'conversation' ? {} : { conflictAgent: conflictPreference }) }); if (result.git) updateGit(task.projectId, result.git); diff --git a/src/web/task-model-picker.tsx b/src/web/task-model-picker.tsx index 89127392..2a1605be 100644 --- a/src/web/task-model-picker.tsx +++ b/src/web/task-model-picker.tsx @@ -1,6 +1,6 @@ import { agentLabel, agentOff, canReviewWith } from './agent-choice.ts'; import { type ReactNode, useEffect, useRef, useState } from 'react'; -import { AGENT_IDS, modelServiceTier, type AgentId, type RuntimeStatus, type Task } from '../shared.ts'; +import { AGENT_IDS, effectiveServiceTier, modelServiceTier, type AgentId, type RuntimeStatus, type Task } from '../shared.ts'; import { AgentPicker } from './agent-picker.tsx'; import { t } from './i18n.ts'; import type { RefreshUsage } from './usage.tsx'; @@ -52,7 +52,7 @@ export function TaskModelPicker({ task, runtime, runtimes, disabled, reconnectin // Resolve model switches after preceding saves, including rapid A/B/A. const next = update(saved.current); const model = runtime?.models.find(model => next.model ? model.id === next.model : model.isDefault); - const serviceTier = model ? modelServiceTier(model, next.serviceTier) : next.serviceTier || 'default'; + const serviceTier = effectiveServiceTier(model, next.serviceTier) || 'default'; const result = await save({ model: next.model || '', effort: next.effort || '', ...(agent === 'codex' ? { serviceTier } : {}) }); remember(saved.current); saved.current = settingsOf(result); remember(saved.current); } diff --git a/tests/app.test.ts b/tests/app.test.ts index 8bb32520..6cb99605 100644 --- a/tests/app.test.ts +++ b/tests/app.test.ts @@ -2395,6 +2395,24 @@ test('quota refresh validates the agent and CSRF and never reconnects conversati } finally { await f.close(); } }); +test('task commit-message routes identify inherited speeds for catalog validation', async () => { + const f = await fixture(); + try { + const taskId = 'thesis-task'; + f.store.updateTask(taskId, { agent: 'codex', model: 'full', serviceTier: 'ultrafast' }); + const speeds: [string | undefined, boolean | undefined][] = []; + f.workspace.commitMessage = async (_project, _paths, choice) => { speeds.push([choice?.serviceTier, choice?.inheritedSpeed]); return { message: 'Clarify the introduction', agent: 'codex' }; }; + const send = (payload: Record) => f.local.inject({ method: 'POST', url: '/api/tasks/' + taskId + '/commit-message', headers: f.as, payload }); + + assert.equal((await send({})).statusCode, 200); + assert.equal((await send({ serviceTier: 'ultrafast' })).statusCode, 200); + assert.equal((await send({ agent: 'codex' })).statusCode, 200); + f.store.updateTask(taskId, { serviceTier: undefined }); + assert.equal((await send({})).statusCode, 200); + assert.deepEqual(speeds, [['ultrafast', true], ['ultrafast', undefined], [undefined, undefined], [undefined, undefined]]); + } finally { await f.close(); } +}); + test('commit-message routes honor explicit agents and default task requests to the conversation', async () => { const f = await fixture(); try { diff --git a/tests/workspace.test.ts b/tests/workspace.test.ts index 7a3d51a6..20fc49d5 100644 --- a/tests/workspace.test.ts +++ b/tests/workspace.test.ts @@ -2254,7 +2254,7 @@ test('commit messages honor model, effort and Fast mode and cache each selection const calls: unknown[] = []; (f.workspace as any).taskCommitChanges = async () => ({ files: [{ path: 'main.tex', status: 'M' }], patch: '-Old\n+New', recent: [] }); (f.workspace as any).oneOff = async (agent: string, options: any) => { calls.push([agent, options.model.id, options.effort, options.serviceTier]); return 'Clarify the introduction'; }; - const write = (choice: { model?: string; effort?: string; serviceTier?: string } = {}) => f.workspace.commitMessage(f.task.projectId, ['main.tex'], { agent: 'codex', taskId: f.task.id, ...choice }); + const write = (choice: { model?: string; effort?: string; serviceTier?: string; inheritedSpeed?: boolean } = {}) => f.workspace.commitMessage(f.task.projectId, ['main.tex'], { agent: 'codex', taskId: f.task.id, ...choice }); await write(); await write(); await write({ model: 'small', effort: 'high' }); await write({ model: 'small', effort: 'high' }); await write({ model: 'small', effort: 'low' }); @@ -2264,6 +2264,12 @@ test('commit messages honor model, effort and Fast mode and cache each selection await assert.rejects(write({ model: 'small', effort: 'ultra' }), /does not support that reasoning effort/); await assert.rejects(write({ model: 'small', serviceTier: 'priority' }), /This speed is not available/); assert.equal(calls.length, 4); + await write({ serviceTier: 'priority', inheritedSpeed: true }); + assert.equal(calls.length, 4, 'a supported inherited speed reuses the message for that speed'); + f.workspace.setHiddenModels('codex', ['full']); + await write({ serviceTier: 'priority', inheritedSpeed: true }); + assert.deepEqual(calls.at(-1), ['codex', 'small', 'low', 'default'], 'an inherited speed is checked against the selected helper model'); + await assert.rejects(write({ serviceTier: 'priority' }), /This speed is not available/); } finally { f.close(); } }); @@ -2870,6 +2876,48 @@ test('the chosen conflict-resolution agent takes over a merge suggestion once it } finally { f.close(); await disk.close(); } }); +test('a queued Codex merge suggestion uses Standard when its chosen speed disappears', async () => { + const { f, disk, settle, wake } = await conflictAgentFixture(); + try { + const model = { id: 'merge-model', name: 'Merge model', isDefault: true, efforts: ['high'], defaultEffort: 'high', serviceTiers: ['priority', 'ultrafast'] }; + f.workspace.runtimes.codex.models = [model]; + const choice = { agent: 'codex' as const, model: model.id, serviceTier: 'ultrafast' }; + const result = await f.workspace.applyTask(f.task.id, false, undefined, choice); + assert.ok(result.reconciliation); + const run = () => f.store.runs().find(run => run.requestKey === 'merge-review-' + result.reconciliation!.id); + await settle(); + assert.equal(run()?.status, 'queued'); + model.serviceTiers.pop(); + f.codex.ready = true; + await wake(); + assert.equal(run()?.status, 'running'); + assert.equal(f.codex.calls.find(call => call.method === 'turn/start')?.params.serviceTier, 'default'); + assert.deepEqual(f.store.task(f.task.id).mergeAgent, choice); + } finally { f.close(); await disk.close(); } +}); + +test('a queued merge with the same Codex settings keeps its task permissions and saved speed', async () => { + const { f, disk, settle, wake } = await conflictAgentFixture(); + try { + const model = { id: 'codex-model', name: 'Codex', isDefault: true, efforts: ['xhigh'], defaultEffort: 'xhigh', serviceTiers: ['priority'] }; + f.workspace.runtimes.codex.models = [model]; + const choice = { agent: 'codex' as const, model: model.id, effort: 'xhigh', serviceTier: 'ultrafast' }; + f.store.updateTask(f.task.id, { permissions: 'full', serviceTier: choice.serviceTier }); + const result = await f.workspace.applyTask(f.task.id, false, undefined, choice); + assert.ok(result.reconciliation); + await settle(); + f.codex.ready = true; + await wake(); + const run = f.store.runs().find(run => run.requestKey === 'merge-review-' + result.reconciliation!.id); + const task = f.store.task(f.task.id); + assert.equal(run?.status, 'running'); + assert.equal(f.codex.calls.find(call => call.method === 'turn/start')?.params.serviceTier, 'default'); + assert.equal(task.permissions, 'full'); + assert.equal(task.serviceTier, 'ultrafast'); + assert.equal(task.mergeReturn, undefined); + } finally { f.close(); await disk.close(); } +}); + test('a conflict-resolution agent that cannot take the task fails the merge run instead of using another agent', async () => { const { f, disk, claude, settle, wake } = await conflictAgentFixture(); try {