feat(cli): add effort command with honest live-state errors (carry of #3528) - #3612
Conversation
Clarify clear versus injection clearing in registry help. Capture console originals once per test so repeated capture helpers and direct mocks restore correctly. Cover clear preserving injection, injection-only clearing preserving caps, and live status denial without offline substitution. Validation: bun run typecheck passed; git diff --cached --check and git diff origin/dev --check passed. Local tests intentionally not run per owner instruction. Co-authored-by: Benedictus Reynaldo Hartanto <hartanto.benedictus.reynaldo.w0@s.mail.nagoya-u.ac.jp>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR adds ChangesEffort CLI
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as ocx effort
participant Dispatch as dispatchCommand
participant Handler as handleEffortCommand
participant Proxy as LiveProxy API
participant Config as config.json
CLI->>Dispatch: submit effort command
Dispatch->>Handler: pass arguments and findLiveProxy
Handler->>Proxy: read or update live effort state
Handler->>Config: read or persist offline state when no live proxy is available
Handler-->>CLI: return status, JSON, or error
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c60f95bb54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (level === undefined || level === null) return level; | ||
| const trimmed = level.trim(); | ||
| if (trimmed === "-" || trimmed === "") return null; | ||
| if (!isDeclaredReasoningEffort(trimmed)) { |
There was a problem hiding this comment.
Reject non-rung values for hard effort caps
When a user runs ocx effort none, ocx effort minimal, or passes either value to --main/--subagent, this validator accepts it because isDeclaredReasoningEffort includes both sentinels. However, /api/effort-caps accepts only isCodexReasoningEffort, and effortCapFor likewise ignores these values: live commands fail with HTTP 400, while offline commands exit successfully and persist a cap that is never enforced. Validate the two hard-cap fields against the actual low-to-ultra cap ladder, and validate injection separately if its accepted set intentionally differs.
Useful? React with 👍 / 👎.
| import { existsSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| import { handleEffortCommand } from "../../src/cli/effort"; |
There was a problem hiding this comment.
Register the new test in both layout inventories
The new cli-effort.test.ts file is absent from both scripts/test-layout/layout.json's explicit map and tests/fixtures/test-layout-expected.json; it currently resolves only through the temporary cli- regex seed. Add the cli mapping to both inventories so the repository's test-layout bookkeeping remains authoritative.
AGENTS.md reference: AGENTS.md:L23-L27
Useful? React with 👍 / 👎.
| ocx effort set --subagent max | ||
| ``` | ||
|
|
||
| The top-level `ocx effort` command is the canonical entry point for effort inspection and caps (e.g. `ocx effort high`, `ocx effort status`, `ocx effort clear`), with `ocx agent effort` preserved as a backward-compatible path. Note that `ocx effort clear` removes active main-agent and sub-agent caps while leaving delegation `injectionEffort` untouched (use `ocx effort set --injection -` or `ocx agent injection set --effort -` to clear injection effort). |
There was a problem hiding this comment.
Add the canonical effort command to the CLI reference
This guide declares ocx effort the canonical entry point and then directs readers to /reference/cli/ for all command families, but neither that page nor its Agents reference page mentions the new top-level family; only the legacy ocx agent effort path is documented there. Add the complete ocx effort syntax and its online/offline behavior to the CLI reference so the directly affected workflow is documented consistently.
AGENTS.md reference: docs-site/AGENTS.md:L15-L16
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
Summary
Carries the effort-only #3528 onto current dev. The agy alias already landed separately. The latest author head preserves exact provider/model selectors, rejects malformed slash selectors, derives the ladder from CODEX_REASONING_LEVELS and keeps live API failures distinct from offline behavior.
This carry completes clear/injection help wording and fixes test console restoration. Bare clear removes main/subagent caps while preserving injection effort; set --injection - is the explicit injection-clear path. Regression assertions cover live-status failures and clearing semantics.
Verification
Checklist
Summary by CodeRabbit
New Features
ocx effortcommand for inspecting and configuring reasoning-effort caps and defaults.ocx effortcommand and its backward-compatible alternative.Documentation