Skip to content

feat(cli): add effort command with honest live-state errors (carry of #3528) - #3612

Merged
lidge-jun merged 3 commits into
devfrom
codex/260905-effort-command-carry
Sep 5, 2026
Merged

feat(cli): add effort command with honest live-state errors (carry of #3528)#3612
lidge-jun merged 3 commits into
devfrom
codex/260905-effort-command-carry

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

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

  • Astra worker typecheck and staged/working diff checks passed.
  • Static verification of live mutation/read failure boundaries and typed dependencies.
  • No local tests or test:changed run. Final dev Linux CI is the batch gate.

Checklist

  • Effort command only; no duplicate alias feature.
  • User-facing help and canonical guide synchronized.
  • Original author credit retained in branch commits.

Summary by CodeRabbit

  • New Features

    • Added the ocx effort command for inspecting and configuring reasoning-effort caps and defaults.
    • Supports live proxy and offline configuration updates, status checks, model inspection, JSON output, and clearing caps.
    • Added validation and clear error reporting for failed or partial updates.
    • Documented the canonical ocx effort command and its backward-compatible alternative.
  • Documentation

    • Updated CLI help and the sub-agent guide with usage details, supported options, and cap-clearing behavior.

benedictusrey888 and others added 3 commits September 5, 2026 07:41
Preserve source head d3d33d2 and merge origin/dev f008a55 without changing the author branch. The alias half is already on dev through #3601.

Co-authored-by: Benedictus Reynaldo Hartanto <hartanto.benedictus.reynaldo.w0@s.mail.nagoya-u.ac.jp>
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>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 03:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T04:01:05.740746Z c60f95b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 208409ce-5f61-4b43-bfc8-33b42430e728

📥 Commits

Reviewing files that changed from the base of the PR and between f008a55 and c60f95b.

📒 Files selected for processing (7)
  • docs-site/src/content/docs/guides/sub-agent-surface.md
  • src/cli/dispatch.ts
  • src/cli/effort.ts
  • src/cli/help.ts
  • src/cli/registry.ts
  • src/cli/runtime-api.ts
  • tests/cli/cli-effort.test.ts

📝 Walkthrough

Walkthrough

The PR adds ocx effort for effort-cap status, updates, clearing, model inspection, JSON output, and live or offline operation. It wires the command into dispatch, help, and the CLI registry, with tests for successful and failed runtime interactions.

Changes

Effort CLI

Layer / File(s) Summary
Command contracts and wiring
src/cli/registry.ts, src/cli/help.ts, src/cli/runtime-api.ts, src/cli/dispatch.ts
The CLI registry and help output document ocx effort. Runtime dependencies can locate a live proxy. Dispatch forwards effort arguments and the proxy resolver to handleEffortCommand.
Effort command behavior
src/cli/effort.ts
The command validates effort values, reads live or offline status, updates caps, clears caps, inspects model effort support, preserves injection-effort semantics, and returns human-readable or JSON output.
Behavior validation and documentation
tests/cli/cli-effort.test.ts, docs-site/src/content/docs/guides/sub-agent-surface.md
Tests cover offline persistence, live API reads and writes, partial updates, verification failures, proxy fallback, selector validation, and top-level dispatch. Documentation identifies ocx effort as the canonical entry point and describes cap-clearing behavior.

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
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260905-effort-command-carry

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

❤️ Share

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

@lidge-jun
lidge-jun merged commit bef04ef into dev Sep 5, 2026
5 of 7 checks passed
@lidge-jun
lidge-jun deleted the codex/260905-effort-command-carry branch September 5, 2026 03:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/cli/effort.ts
if (level === undefined || level === null) return level;
const trimmed = level.trim();
if (trimmed === "-" || trimmed === "") return null;
if (!isDeclaredReasoningEffort(trimmed)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants