feat: add additional effort levels#1663
Draft
sadpandajoe wants to merge 2 commits into
Draft
Conversation
Maps all advisorModel touch points (= the ultracode change list), analyses the /tmp collision problem, and recommends a unique per-session settings file as the delivery mechanism. Includes compatibility guards and open questions for review before implementation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wires two new capabilities end-to-end through the Agor stack: **`minimal` effort for Codex** - Adds `'minimal'` to `EffortLevel` union (types/session.ts, types/user.ts) - Passes `minimal` through to Codex SDK unchanged (its native ceiling is `xhigh`; this adds the floor) - Clamps `minimal → 'low'` in both Claude delivery paths via a shared `toClaudeEffort()` helper: - `packages/core/src/claude-cli/spawn-config.ts` (CLI path) - `packages/executor/src/sdk-handlers/claude/model-utils.ts` (SDK path) - MCP schemas updated in `sessions.ts` + `schedules.ts`; UI `EffortSelector` gains a 'Minimal' option at the bottom with a Codex-only note **ultracode mode for claude-code / claude-code-cli** - Adds `ultracode?: boolean` to `Session.model_config`, `SpawnConfig.modelConfig`, `DefaultModelConfig`, and the MCP tool schemas - Delivery via unique per-session settings file (`~/.agor/session-flags/<session-id>.json`) to avoid the /tmp content-addressing collision that causes EACCES when identical inline Settings JSON is shared across concurrent sessions/users - CLI path: `claude-cli-integration.ts` writes the file before spawn and passes its path via `ClaudeCliSpawnConfig.ultracodeSettingsPath` → `--settings <path>` - SDK path: `query-builder.ts` writes the file, sets `queryOptions.settings = path`, and returns the path to the caller; `prompt-service.ts` cleans it up in a try/finally - Guard in `agor_sessions_create`: rejects `ultracode: true` with a descriptive error when `agenticTool` is not claude-code/claude-code-cli - `spawn-subsession-template.ts` surfaces ultracode in Handlebars context display Tests: resolve-config round-trips (ultracode + minimal), spawn-config (--settings arg + toClaudeEffort clamp), query-builder (ultracode file path uniqueness + minimal→low), daemon sessions (guard rejection + ultracode thread-through + minimal thread-through) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
minimaleffort for Codex — adds'minimal'as a newEffortLevel, which passes through to the Codex SDK natively (its lowest tier) and clamps to'low'on both Claude delivery paths (SDK query-builder + CLI spawn-config). TheEffortSelectorUI gains a 'Minimal' option at the bottom with a note that Claude uses Low instead.ultracodemode forclaude-code/claude-code-cli— enables Claude Code's xhigh-effort + standing-workflow-orchestration mode via a per-sessionSettingsfile (~/.agor/session-flags/<session-id>.json), not inline Settings JSON. The inline-object path is deliberately avoided: the Claude CLI content-addresses inline JSON to/tmp/claude-settings-<hash>.jsonmode 0600; identical settings across concurrent sessions (or different Unix users under insulated/strict mode) resolve to the same hash and fail withEACCES. The file-path form (Options.settings = '<path-string>') is unique per session via UUID. A guard inagor_sessions_createrejectsultracode: truewith a descriptive error when the agenticTool is notclaude-code/claude-code-cli. The settings file is cleaned up after each prompt turn (try/finallyin prompt-service.ts); the CLI path mirrorsmcpConfigPath(best-effort, lifecycle hook deferred). Mid-sessionapplyFlagSettingsdelivery is out of scope —ultracodeapplies from the first turn of a new session.Q-decisions wired (from spec)
ultracodeonmodel_config✓ultracode: true+ non-claude-code tool ✓mcpConfigPathlifecycle ✓applyFlagSettingsout of scope ✓Files changed
packages/core/src/types/session.ts'minimal'toEffortLevel; addultracode?toSession.model_configandSpawnConfig.modelConfigpackages/core/src/types/user.tsultracode?toDefaultModelConfigpackages/core/src/models/resolve-config.tsultracodethroughModelConfigInput→resolveModelConfig→ fallback overridespackages/core/src/db/schema.{sqlite,postgres}.tsultracode?to inline model config shapes indefault_agentic_configpackages/core/src/templates/spawn-subsession-template.tsultracodein Handlebars display and JSONpackages/core/src/claude-cli/spawn-config.tstoClaudeEffort()clamper; addultracodeSettingsPath?toClaudeCliSpawnConfig; emit--settings <path>packages/executor/src/sdk-handlers/claude/model-utils.tstoClaudeEffort()clamper (SDK path)packages/executor/src/sdk-handlers/claude/query-builder.tstoClaudeEffort()for effort; write ultracode settings file, setqueryOptions.settings = path, returnultracodeSettingsPathpackages/executor/src/sdk-handlers/claude/prompt-service.tsultracodeSettingsPath; unlink infinallyblockpackages/executor/src/sdk-handlers/codex/prompt-service.tstoCodexReasoningEffortreturn type to include'minimal'apps/agor-daemon/src/mcp/tools/sessions.tsultracodetomodelConfigObjectSchema; update effort enum; add Guard A; reuseexplicitModelConfigapps/agor-daemon/src/mcp/tools/schedules.tsultracodeand'minimal'effort toagenticToolConfigSchemaapps/agor-daemon/src/services/claude-cli-integration.tswriteUltracodeSettingsFileIfNeeded(); usetoClaudeEffort()for effort clamp in CLI pathapps/agor-ui/src/components/EffortSelector/EffortSelector.tsxapps/agor-ui/src/components/ModelSelector/ModelSelector.tsxultracode?toModelConfig; addhandleUltracodeChange; add checkbox in claude-code sectionapps/agor-ui/src/components/SessionPanel/SessionPanel.tsxultracodethroughmodelConfigconstruction andhandleModelConfigChangePLAN.mdTest plan
packages/core—resolveModelConfigultracode + minimal round-trips;spawn-config--settingsarg +toClaudeEffortclamp (5 new assertions)packages/executor—query-builder: ultracode settings path is unique per session + under.agor/session-flags/; minimal clamped to 'low'; codex prompt-service existing tests still greenapps/agor-daemon—sessions.test.ts: Guard A rejectsultracode+codex; ultracode threads tomodel_config;minimaleffort threads tomodel_config; all 1293 existing daemon tests pass@agor/core,@agor/executor,@agor/daemon,agor-uiall greenDRAFT pending Joegor review of ultracode settings-file delivery approach and UI checkbox placement.
🤖 Generated with Claude Code