Skip to content

Add notebook AI credit budgets and tier-aware model controls - #1082

Draft
koutst wants to merge 2 commits into
mainfrom
codex/notebook-ai-credits
Draft

Add notebook AI credit budgets and tier-aware model controls#1082
koutst wants to merge 2 commits into
mainfrom
codex/notebook-ai-credits

Conversation

@koutst

@koutst koutst commented Sep 4, 2026

Copy link
Copy Markdown
Member

The notebook assistant now shows the user's shared Research AI credit allowance and applies the model permissions returned by the API. Previously, model availability was cached globally and the composer did not account for credit or daily provider-call limits.

  • Add a session-scoped budget and model catalog, with fractional credits, local reset times, and refreshes on notebook open, window focus, active-turn polling, completion, failure, cancellation, and budget errors.
  • Hide model and generation controls for default-tier users and send only their message. For permitted tiers, use the catalog default for new chats, restrict selection to allowed models, display estimated multipliers, and lock the model after the first submitted turn.
  • Distinguish daily exhaustion, account-wide and conversation-specific busy responses, model validation errors, and access restrictions. Preserve unsent drafts and Stop controls, and recover after the daily reset. Accept nullable execution iteration limits.

Existing notebook access permissions remain in place. This integration expects the updated Research AI API with nested credits and model pricing metadata.

Validation:

  • node --test tests/notebook-ai.test.cjs — 13 passing tests covering budget exhaustion, unlimited allowances, fractional pricing, model selection/locking, cancellation and immediate resubmission, draft retention, stale refresh races, and reset recovery.
  • Targeted ESLint checks — passed.
  • npm run type-check — passed after restoring the already-declared Markdown dependencies in the local environment; no dependency manifest changes.
  • git diff --check — passed.

Live end-to-end validation against the updated backend has not been run.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
web Ready Ready Preview Sep 4, 2026 3:51pm UTC

Request Review

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

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