Skip to content

feat: add interactive Limits workspaces - #405

Open
saioai wants to merge 35 commits into
mainfrom
codex/new-spend-units-20261009
Open

saioai wants to merge 35 commits into
mainfrom
codex/new-spend-units-20261009

Conversation

@saioai

@saioai saioai commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Organization owners previously managed spend limits, alerts, and project rates through separate commands.
The Limits workspace combines these controls with exact-dollar review before each change.
This update retains drafts through help, keeps errors visible, and adds the documented fine-tuning model-limits read.

What changes

  • Manage organization and project monthly USD hard limits, spend alerts, and all six public project rate fields.
  • Review exact-dollar changes beside original API fields. Preserve drafts, focus, and prefix mode through help and review.
  • Keep diagnostics and recovery actions visible. F1 opens complete details; help returns to review with Back selected.
  • Show completeness before counts. Keep section and field focus visible in color and monochrome output.
  • Show reported current-month Costs with exact totals, project filtering, original buckets, and incomplete-data warnings.
  • Read fine-tuning model limits with ordinary credentials. Preserve unfamiliar fields, valid JSON shapes, formats, extraction, and raw output.
  • Reject malformed or empty successful model-limit responses with safe base-URL and retry guidance.
  • Preserve uncertain-save protection, cancellation, caller-owned output sinks, and machine error contracts.

Alerts remain notifications. Missing enforcement stays unknown. Preflight checks are not atomic, and today's Costs remain partial.

Commands

The workspace routes and fine-tuning read are new. Existing scriptable administration commands remain available.

openai admin limits                                      # organization workspace
openai projects limits --project-id proj_example         # project workspace
openai admin limits show --format json                   # read-only overview
openai projects limits show --project-id proj_example --format json
openai admin limits show --max-items -1                  # fetch all list records
openai fine-tuning model-limits --format json            # ordinary API key

# Existing scriptable commands still accept integer cents.
openai admin spend-limit update --currency USD --interval month --threshold-amount 12550

Administration uses OPENAI_ADMIN_KEY or --admin-api-key. Forms accept decimal dollars; existing commands retain integer-cent inputs.
Fine-tuning model limits uses OPENAI_API_KEY or explicit Authorization. OPENAI_ADMIN_KEY does not supply this command's credentials.
It reads one documented endpoint, adds no pagination, and retains SDK read retries.
Root request context and output options remain available.

Pipes, CI, quiet mode, explicit formats, and extraction select the read-only Limits overview.
Workspace lists default to 100 records. --max-items -1 fetches all; 0 validates requests without retaining records.

F1 opens help. Escape restores the draft. Resizing requires rereading the review before Apply becomes available.
Wrapped previews support inspection. Ctrl+P prints complete command bytes after terminal restoration, then exits without applying the draft.
Private overrides and unsupported launch contexts omit printing.
Workspace mutations never retry automatically. Printed commands retain SDK retries and omit workspace preflight checks.

Code

pkg/custom owns handwritten commands, API orchestration, workspace behavior, exact arithmetic, and recovery.
internal/output/transform owns projections. Existing request, output, and terminal helpers retain their responsibilities.
The fine-tuning read uses the SDK request path without inventing a schema.
Synthetic recorder fixtures remain under scripts/demos. This update adds no packages or dependencies and leaves generated sources and main.go unchanged.

Full website parity needs public contracts for soft budgets, independent enforcement, tiers, upgrades, credits, and approved usage-limit controls.
Organization rate catalogs, percentage alerts, delivery history, and trigger status also remain unsupported by inspected contracts.
Use Platform Limits for available website controls.
Deleting a hard limit does not preserve a soft budget.

Tested

Candidate: cc902da508ba18d18478b8e08bd0aa67368e74de. Base: e539d9772a0db679dc2c5c1f77fec4df556c9980.
Focused checks passed: 22 test parents, 224 test/subtest events, two packages, and zero failures or skips.
The native macOS arm64 build passed.
Bash and Zsh executed eight copied help examples and 32 printed-command cases.
Independent adversarial review accepted the source, runtime results, and terminal captures.

CI at cc902da5: 41 checks passed and four skipped. Both Castiron status contexts passed. Automated code and security reviews completed with no unresolved findings.
Both eleven-scene recordings passed at 80x24 color and 40x12 monochrome.
Independent reviewers inspected all 160 screenshots and 104 samples across 24 animations.
Checks verified mutation counts, exact command printing, error recovery, expected exits, terminal restoration, and cleanup.
SDK CODEOWNER approval remains pending.

Three historical filesystem preflight cases skipped at 555fbc74; invalid-byte filename coverage remains unverified locally.
Checks use synthetic fixtures. Live API acceptance, billing changes, and account-specific entitlements remain untested.
Interactive scripts/run, PowerShell, fish, graphical terminals, and Windows/Linux terminal interactions remain unverified.

Demo

Before shows the standalone command at e6893982. After and the GIF show cc902da5.
Both use a synthetic USD 100.00 monthly hard limit. The workspace also shows synthetic alerts, rates, and Costs.
Recordings use Bash on macOS arm64, Menlo 18px, and synthetic loopback fixtures.

Limits workflows at cc902da5

Before, historical e6893982:

Before: standalone spend-limit output

After, cc902da5:

After: organization Limits workspace

Recording recipe, scenes, and workspace guide.

@saioai

saioai commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Castiron custom code

Evaluated main: 6ec670807e4d9b81d5c58690901c80e121822806.

Trusted main policy: 6ec670807e4d9b81d5c58690901c80e121822806.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared e539d9772a0d → cc902da508ba. Generated baselines verified.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 39348534727 --repo openai/openai-cli \
  --name castiron-custom-code-39348534727-1 --dir /tmp/castiron-custom-code-39348534727-1
git apply --stat /tmp/castiron-custom-code-39348534727-1/custom-code.patch
cat /tmp/castiron-custom-code-39348534727-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 6ec670807e4d9b81d5c58690901c80e121822806 cc902da508ba18d18478b8e08bd0aa67368e74de
python3 scripts/castiron/custom_code_report.py report \
  --base 6ec670807e4d9b81d5c58690901c80e121822806 \
  --head cc902da508ba18d18478b8e08bd0aa67368e74de --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-cc902da508ba
cat /tmp/castiron-custom-code-cc902da508ba/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-10-20T00:32:41.831950Z cc902da New commits
🔒 Security Review ✅ Completed 2026-10-20T00:28:52.374311Z cc902da New commits
ℹ️ 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.

@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: ae7fe7fa13

ℹ️ 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 internal/output/transform/project_spend_threshold.go
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: ae7fe7fa13

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@saioai

saioai commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 56bc61b929

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 56bc61b929

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

saioai added 19 commits October 16, 2026 15:07
# Conflicts:
#	pkg/custom/local_errors.go
#	pkg/custom/readable_errors.go
@saioai saioai changed the title feat: show spend threshold units and alert semantics feat: add interactive Limits workspaces Oct 19, 2026
@saioai
saioai marked this pull request as ready for review October 19, 2026 21:48
@saioai
saioai requested a review from a team as a code owner October 19, 2026 21:48

@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: e3968446be

ℹ️ 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 pkg/custom/limits_workspace.go Outdated
Comment thread pkg/custom/local_errors.go

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant