Repository navigation
feat(claude): Ultracode as its own switch, beside effort (#2232) - #2266
Conversation
Since Claude Code 2.1.284 Ultracode is a setting of its own that keeps the
session's effort level, not an effort level.
- New workspace and New tab drop `ultracode` from Claude Code's effort list
and offer an Ultracode switch after Effort. On, the launch adds
`--settings '{"ultracode":true}'` (verified on 2.1.311: medium effort with
Ultracode on); off adds nothing. The bridge still accepts
`--effort ultracode` from older pages and other clients.
- On a native Windows PC the bridge passes that inline JSON as the path of a
settings file under %LOCALAPPDATA%\ovis\claude-settings: PowerShell 5.1
strips its quotes on the hop through npm's claude.ps1 shim, and Claude Code
then exits with "Invalid JSON provided to --settings" (reproduced on a
Windows 11 PC with the real npm package).
- Claude Code's /effort card reads the 2.1.311 slider with Ultracode on, in
panes narrower than 70 columns, at max without Ultracode and with the key
unbound, where it showed no card before, and offers a Turn Ultracode on/off
row: Tab, then `s` only once the slider shows the switch flipped on the
same level. Only arrow keys move the shared picker plan's cursor now.
- Real 2.1.311 /effort screens from an isolated herdr as fixtures, trimmed
to the dialog.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Launch capability and arguments shared/launch-rules.ts, src/lib/agentLaunchMode.ts, src/lib/newSession.ts, docs/agent-commands.md, DESIGN.md, changelog.d/claude-ultracode-switch.md |
Claude’s listed effort levels exclude Ultracode, while launch validation still accepts --effort ultracode. Supported Claude launches append the Ultracode settings JSON after effort. |
New-session dialog and launch guidance src/components/NewSessionDialog.tsx, src/components/SettingsControls.tsx, src/components/NewSessionDialog.css, scripts/new-session-skills-browser-qa.ts, src/lib/i18n/* |
The dialog shows the switch for supported agents, resets it when the dialog opens or the selected agent does not support it, and passes the choice into launch configuration. Browser checks and translations cover the switch. |
Windows Claude settings arguments server/claude-settings-file.ts, server/agent-launch.ts, server/claude-settings-file.test.ts, server/agent-launch.test.ts, server/windows-native.test.ts |
On Windows, Claude inline JSON settings arguments are rewritten to settings-file paths. If file handling fails, the original arguments are retained. |
Claude /effort Ultracode card server/dialogs/claude.ts, server/dialogs/interaction-plan.ts, server/dialogs/shared.ts, server/dialogs/*test.ts, server/prompt.test.ts, server/outcome.test.ts, server/fixtures/claude-effort-2.1.311-*, shared/card-text.ts, docs/agent-commands.md, docs/guide.md, changelog.d/claude-ultracode-switch.md |
The card recognizes the displayed switch and offers a toggle when its Tab binding is present. Interaction plans reread the prompt and apply changes only when the switch and effort state match the plan. |
Demo resumed-session detection
| Layer / File(s) | Summary |
|---|---|
Agent-specific resume arguments site/demo/fixtures.ts, site/demo/transport.ts, scripts/demo-tabs.test.ts |
Tab creation assigns a session ID only when the agent’s arguments match its recognized resume flags and a single string session ID. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature · Severity of issue fixed: Medium
Merge Risk: 
Minimal · previous review f5398
-
No actionable issue remains identified; the change appears mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description is detailed and covers the change, resulting behavior, compatibility, validation, tests, and scope. It does not use the exact template headings, but it provides the required information in clearly labeled sections.
Full details: Linked Issues check
-
Explanation
Issue
#2232requires an independent Claude Ultracode control, effort values withoutultracode, session launch settings,/effortstate detection and Tab handling, and continued acceptance of--effort ultracode.src/lib/agentLaunchMode.tsimplements the separate capability and emits--settings {"ultracode":true}only when enabled.shared/launch-rules.tskeepsultracodeout ofCLAUDE_EFFORTSand accepts it for compatibility. The updated Claude reader, interaction plans, fixtures, and tests cover the requested layouts and guarded toggle application. The conditional settings merge is not needed for the current Ovis or herdr launch paths because they do not supply another--settingsvalue.
Full details: Out of Scope Changes check
-
Explanation
The changed files remain connected to issue
#2232. The Windows settings-file path preserves the required launch behavior through PowerShell. Demo resume detection prevents settings arguments from becoming fake session IDs. Agent-choice resets, picker toggle tracking, accessibility attributes, documentation, fixtures, and automated tests support the new switch and/effortcard behavior. No demonstrated unrelated change is present.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 78.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 19 functions across 33 files. (17 skipped: 17 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
…r instead of wording Co-authored-by: sisyphus-dev-ai <[email protected]>
|
Merging 242e4d0, from the owner's own session (w28). Codex was at capacity, so an omo reviewer and an independent second reviewer reviewed it. Ultracode is now its own switch beside effort: the launch adds |
…r-fit timing out under load (#2287) Closes #2285 ## What was wrong `Browser regression (other scripts)` kept ending as cancelled at its 50-minute `timeout-minutes`. It looked like hung demo scripts, but no script hung. Each job waited a long time for a herdr check slot (`scripts/check.ts`, `check: took a slot after Ns`) and then ran the lane until the job timeout stopped it: | job | PR | slot wait | lane before the cancel | | --- | --- | --- | --- | | 122862337418 | #2266 attempt 1 | 1340 s | finished, 107/108 in 1238 s (a real `file-viewer-regression.ts:1395` failure) | | 122889113275 | #2266 attempt 2 | 2110 s | 14 min, cancelled | | 122878703515 | #2260 | 1755 s | 20 min, cancelled | | 122872125320 | #2275 | 1635 s | 22 min, cancelled | The scripts that "STARTed and never finished" were the ones running at the cancel. Their logs in the browser-logs artifact print `PASS` lines up to the cancel second. For example, `sidebar-activity-demo-regression.log` ends with a PASS at 15:35:59, the same second as `##[error]The operation was canceled.` The longest single script run in these jobs was 357 s. `ci.yml` gives these jobs `timeout-minutes: 50` and `CHECK_WAIT_SECONDS: 2400`, and time spent waiting for a slot counts against the timeout. On 2026-10-28 the P620 had 20 runners queuing for 4 slots (`CHECK_HOST_MAX_RUNS=4`), and waits reached 37.6 min. ## What this PR changes `scripts/ci-browser-parallel.ts` now limits each run of a script to `BROWSER_SCRIPT_TIMEOUT_SECONDS` (default 600 s, about twice the slowest run seen on a loaded host). Before this, a script that really hung, or a process it started that kept its output open, would have used up the whole job. Past the limit: - the script's whole process tree (read from `ps` before anything is signalled, so Chromium and servers it started are included) gets SIGTERM, then SIGKILL after 5 s; - the lane prints `TIMEOUT <script>` and the script's last 40 log lines straight away; - the script fails with exit 124 and is not run a second time; - the summary, `summary.json`, the `::error` annotation and the job summary all name it with `Timed out after Ns`. It also fails a script that exits but leaves a process holding its output open: if the output is still open 5 s after the exit, the run fails with `Exited N, but a process it started still held its output`. A run's processes carry a mark in their environment, so the stop finds them through `/proc` on Linux even after they are moved to init. Anything still alive after the SIGTERM grace gets SIGKILL, including a child that ignores SIGTERM and writes nowhere. The script's own pid is only signalled while the script is still running. `scripts/composer-fit-demo-regression.ts:278` gave `setInputFiles` a 32 MiB + 1 byte buffer. Playwright sends a buffer to the page as base64 (about 45 MB), which on a loaded host ran past the 30 s timeout. That is a real load failure inside this job: it failed twice in #2260's job and twice in a row locally at load 80-110. It now passes a sparse file of the same size by path. Chromium reads only its size, and the app still refuses it by size (`src/lib/api.ts`) before reading. `docs/development.md` documents the setting and says to check the slot wait first when a job is cancelled at its timeout. No workflow file is changed. ## Done outside this PR - Host (Dori's call): the P620's runner count goes from 20 to 8 (2 reserved for main, 6 for PRs), with `CHECK_HOST_MAX_RUNS=4` kept. With 4 slots, at most 4 jobs can wait, so in the worst case a job waits one slot round (about 20 min) and then runs the lane (about 21 min), within 50 min. Jobs beyond that now queue at GitHub, which does not count toward `timeout-minutes`. - Proposal for the owner, not applied: `timeout-minutes: 50` -> `75` for Integration tests, Browser regression (ui-regression) and Browser regression (other scripts), so the 40-minute `CHECK_WAIT_SECONDS` budget and the lane both fit inside the job. ## Verification - `bun test scripts/ci-browser-parallel.test.ts`: 4 pass. The two deadline tests fail on the runner before this PR: the hung stub runs into the test's 15 s spawn limit, and the exit-but-holding stub is never caught. - The real runner on a hung stub that leaves a child holding stdout, with `BROWSER_SCRIPT_TIMEOUT_SECONDS=2`. Before this PR it still showed only `START` when the outer bound killed it at 30 s, and the child was left alive. With it, the run exits 1 after 2.4 s, with `TIMEOUT`, the script's last lines and exit 124, and the child is gone. - A child that ignores SIGTERM and writes nowhere. It survived the first commit of this PR (Codex's HIGH) and is killed by the second. - The six scripts named in the issue, run through the parallel runner with 6 workers and `BROWSER_RETRY=0` under `dori heavy` on a host at load 60-110: - with the composer-fit fix: 6/6 in each of three runs (359 s, 334 s, 320 s); - before it: 5/6 twice, both times composer-fit failing with `setInputFiles` timing out at line 278. The other five scripts passed every time. None hung, and none was reported STOPPED with real Chromium. - `bun run check fast` on 72d6486: typecheck, build, and unit tests (8250 pass, 0 fail). - Reviews: - omo-native-code-reviewer: PASS, with one MEDIUM (a script that exits but leaves a process holding its output) that is now fixed. - Codex Sol 6.1 fast xhigh: first review BLOCK, on a HIGH (a child ignoring SIGTERM survived), two MEDIUMs (re-parented children, stale pids) and one LOW (zombies in the test). All were reproduced and fixed, and the re-review is a PASS. Known limits it names: on Linux, orphans are found through `/proc`, and a narrow pid-reuse race remains between reading and signalling. - The composer-fit change (test only) had no separate reviewer.
#2282) <!-- See CONTRIBUTING.md for checks, translations, contract tests and the changelog (a file in changelog.d/, never CHANGELOG.md). --> ## Change Thanks to @fivetaku for this PR. #2266 shipped the Ultracode switch first, with its Windows settings file and the `/effort` card's row. In New workspace and New tab, though, the switch took a third column with a three-line hint. This PR's compact line under the effort level reads better, so the maintainers carried that layout over to main here, with maintainer edits: - **Merged main in.** The 7 conflicts resolve to main's #2266 implementation. It supersedes this branch's first commit: the effort list, `--settings '{"ultracode":true}'`, the resets, Windows and the `/effort` card all stay as #2266 made them. - **One line under Model and Effort.** In New workspace and New tab with Claude Code, Model and Effort take the row: two columns at desktop and phone widths. Ultracode goes below them as one line, as tall as the switch: - Settings' theme switch (`role="switch"`, not a native checkbox); - the name "Ultracode"; - a dim note, "Claude Code 2.1.284 or later", which ellipsizes first. - **The full sentence.** "Dynamic workflows at any effort level. Needs Claude Code 2.1.284 or later." is now the switch's description (`aria-describedby`, visually hidden) and the line's tooltip (`title`). The note keeps the version requirement visible on a phone, where a tooltip never shows. ko, ja and zh have the note. - **This branch's shared constant.** `CLAUDE_ULTRACODE_SETTINGS` is now in `shared/launch-rules.ts`, and `src/lib/agentLaunchMode.ts` uses it in place of its own copy. The value is byte-identical, and the launch-rules test checks it through the constant. - **Docs.** DESIGN.md and #2266's unreleased changelog fragment describe the new layout and credit @fivetaku. The fragment already says "Reported by @fivetaku". The layout follows the owner's review of #2266 and this PR's compact line. It is not modeled on another app: it reuses this app's own Settings row, a switch with its name beside it, so the control looks the same in both places. Nothing else changes for the switch: - it is off at every opening and goes off when another agent is picked; - the launch arguments are the same; - the native Windows settings file and the `/effort` card are as before. ## Before and after Left is main (#2266), right is this PR. Both are from the demo build at 1280x800 and 390x844, light and dark, in New workspace and New tab, with Ultracode off and on (plus Korean). The Ultracode block went from 116-134 px to 36 px. The owner reviewed 20 before/after pairs from the demo build before this push; the merge pass can see them at `~/.dori/reports/ultracode-row/` (`index.html`, `pair-*.png`) on the maintainer's PC. 320 px phone shots are in `raw/after-320/`. ## Validation - **Browser QA** (`scripts/new-session-skills-browser-qa.ts`): - **New check:** `assertUltracodeLine` checks, at 1280, 390 and 320, that Model and Effort share a row, Ultracode sits below them on one line no taller than its switch, and the version is in its note, description and tooltip. - **Fails on main:** run on main's dialog it fails with "Ultracode is under Model and Effort, not beside them at 1280". - **Passes here:** all 7 scenarios pass on this branch. They cover the create body, the resets after Start and Escape, and the tab order. - **Old check replaced:** #2266's own layout check ("on Effort's row at a desk") is replaced by this one. - **Checks:** `bun run check fast` passes: typecheck, build and unit tests. - **Reviews:** two adversarial reviews of the diff against main. - **omo-native-code-reviewer:** PASS, with 5 LOW findings. - **Codex Sol 6.1 Fast xhigh:** found 1 MEDIUM: Model and Effort stacked on a 320 px phone. 4f76bfe fixes it and adds a 320 px check to the browser QA. Codex's re-review of that fix is PASS. - **LOWs fixed:** the label now dims while the switch is disabled, and DESIGN.md's wording is corrected. - **LOWs left as they are:** - On touch screens the tooltip never shows, by design: the short note keeps the version requirement visible there. - At 320 px the note and the Korean Effort placeholder may be cut short. - The "no taller than its switch" check is loose, but the one-line checks on the label and the note cover wrapping. --------- Co-authored-by: fivetaku <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: devswha <[email protected]>
Closes #2232.
Since Claude Code 2.1.284, Ultracode is its own setting that keeps the session's effort level, not an effort level. Ovis still offered it as one. This PR moves it to a switch in both places the issue names. It also fixes an existing gap it exposed: Claude Code's
/effortcard never showed while Ultracode was on, or in a pane narrower than 70 columns.New workspace / New tab
low–maxonly.Toggle, has a label and a hint, and the hint is linked witharia-describedby.--settings '{"ultracode":true}'after--effort.--effort ultracode(xhigh + Ultracode) from older pages and other clients.launchArgsFaultuses a separate accepted list (shared/launch-rules.ts). Nothing in Ovis or herdr passes--settingstoday, so there is nothing to merge.claude.ps1shim toclaude.exe, and Claude Code then exits withError: Invalid JSON provided to --settings.%LOCALAPPDATA%\ovis\claude-settings(server/claude-settings-file.ts). If that write fails, it falls back to the inline JSON.tab/createread any two-itemargsas a resume, so["--settings", json]became a fake session id. It now counts a resume only by the agent's own resume flag./effortcardparseClaudeEffortnow reads every 2.1.311 slider screen. A card now appears in these cases:Ultracode: dynamic workflows on every taskunder the names;sonce a re-read shows the switch flipped with ▲ on the same level; otherwise the route answers 409. Tab alone only flips a draft in Claude's dialog, Esc discards it, andsapplies it for this session only. A level row still sends arrows thens, andsgoes out only while the switch shows the state the card was read with. The row appears only when the key reads Tab.server/dialogs/interaction-plan.ts(claude-model, claude-effort, codex-model, pi ×2, omo-model, omp-model), only arrow keys move the cursor now. Before, any other key counted as a step back, so a Tab would have been counted as ←. The other pickers send only arrows before their final key, and their tests pass unchanged.ParsedPromptfield thatpublicPromptdoes not send. An older client shows the row in English.pane.readat 120/70/69/60 columns, trimmed to the dialog.Verification
--effort medium --settings '{"ultracode":true}'starts at medium with Ultracode on.--settingsflags, only the last applies, as the issue says.--settingsvalue adds to~/.claude/settings.jsonrather than replacing it./effortlayouts at 120/70/69/60/44 columns were captured.sand Enter behave as described above, and nothing is written tosettings.json.agent.startargs intact and adds no flags. Checked in an isolated session with a stand-inclaude, including JSON, quotes,$and backticks.@anthropic-ai/claude-code2.1.312 in a temp prefix:Invalid JSON provided to --settings.server/windows-native.test.tscase proves the same with a stand-in shim in the Native Windows job.bun run check fastpasses, andscripts/new-session-skills-browser-qa.tspasses. The QA covers the switch, the create body, Codex with no switch, the agent-switch and reopen resets, and the 390/1280 layout.Notes
server/andshared/changed, so the next release PR raisesREMOTE_BUNDLE_VERSION. Nothing here needs it for compatibility: an older bridge already accepts the new args.claude --resume <id>. They do not re-apply Ultracode, nor model, effort or permission mode, as before.🤖 Generated with Claude Code