Skip to content

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

Merged
koutst merged 6 commits into
mainfrom
codex/notebook-ai-credits
Sep 10, 2026
Merged

Add notebook AI credit budgets and tier-aware model controls#1082
koutst merged 6 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 and effort after the first submitted turn.
  • Keep the last valid model catalog through transient refresh failures, block model-selectable first turns until a catalog is available, and queue an authoritative refresh when a model rejection races another catalog request.
  • Distinguish daily exhaustion, account-wide and conversation-specific busy responses, model validation errors, and access restrictions. Preserve the selected model and generation settings when a new chat receives its ID, including retries after a rejected first attempt. Preserve unsent drafts and Stop controls, and recover after the daily reset. Accept nullable execution iteration limits.

Retain notebook access denials while the credit budget loads, including when the panel closes before that request settles. Access restrictions reset when switching notebooks. Status messages use native accessible output elements.

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

Validation:

  • Formatting and targeted ESLint checks — passed.
  • npm run type-check — no errors reported in PR files; the full command currently stops on the rebased main branch's untyped Turnstile callback in components/Auth/screens/Signup.tsx:136.
  • 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 10, 2026 5:11pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 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-09-10T17:19:02.211999Z 9e62cf3 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: 1d865e76e0

ℹ️ 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 store/researchAI.ts Outdated
Comment thread store/researchAI.ts Outdated

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

ℹ️ 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 hooks/useAgentModelSelection.ts Outdated

@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: 898cf04025

ℹ️ 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 components/Notebook/AgentChat/AgentChatPanel.tsx Outdated

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

ℹ️ 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 components/Notebook/AgentChat/AgentChatPanel.tsx Outdated
@sonarqubecloud

Copy link
Copy Markdown

@koutst
koutst merged commit 4074b06 into main Sep 10, 2026
4 of 5 checks passed
@koutst
koutst deleted the codex/notebook-ai-credits branch September 10, 2026 17:50
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