Skip to content

feat(chatgpt): support Business usage-limit guidance - #7941

Merged
iscekic merged 4 commits into
mainfrom
feat/siwc-business-limit
Oct 19, 2026
Merged

iscekic merged 4 commits into
mainfrom
feat/siwc-business-limit

Conversation

@iscekic

@iscekic iscekic commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Change

  • Recognize the ChatGPT Business workspace usage-limit error.
  • Retain its code in the existing connection notice with an additive nullable column.
  • Show the partner-prescribed Business modal and copy-for-admin action on the existing settings cards.
  • Keep consumer actions, authentication, and billing unchanged.

Verification

  • Reproduced missing Business detection before the fix.
  • Passed targeted parser, persistence, router, modal, and settings-card regression suites on an isolated VM.
  • Passed database, shared-library, and web type checks, scoped lint, and schema migration consistency.
  • Applied the generated migration to disposable PostgreSQL.
  • Exercised the real settings page with a fake account, including successful and denied clipboard access.
  • Passed responsive modal, exact clipboard-content, and keyboard-dismissal checks on the real VM settings page.
  • Independent data-flow and modal reviews found no regressions.

Scope

This extends the existing settings notice. It does not add active-chat modals, mobile UI, or direct Codex handling.

Deployment

Apply the database migration before deploying the gateway and web code that reads the new column.

@iscekic iscekic self-assigned this Oct 18, 2026
@iscekic

iscekic commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Verified the real settings modal on an isolated VM with a fake account. Clipboard content, denied clipboard access, keyboard dismissal, and responsive layout passed. Visual assertions passed. The captures contain only the dialog.

Business usage-limit modal on desktop

Business usage-limit modal on a narrow screen

@kilo-code-bot

kilo-code-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The only incremental change is expanded interaction coverage in ChatGptUsageLimitDialog.test.ts; the new DOM-mocking tests exercise the Business copy action, clipboard success, denied/unavailable fallback, selection on focus, and retry cleanup, with no correctness, security, or memory-leak concerns, and the previously reported test-coverage gap is resolved.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (2 files changed since 53132a4)
  • apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.test.ts - no issues (adds linkedom-based interaction tests; installs and restores DOM globals per test, unmounts the React root in afterEach, and dispatches a bubbling focusin to verify the fallback selects its full content; no leaks or logic errors)
  • apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.tsx - targeted re-verification only (unchanged since 53132a4; the read-only fallback Textarea and onFocus select behavior asserted by the new tests are present)
Prior findings resolved
  • ChatGptUsageLimitDialog.test.ts line 41 (Business-case test only asserted absence of consumer links): resolved by ae99760da4, which adds success, denied, and unavailable clipboard coverage plus fallback/selection/retry assertions.
  • ChatGptUsageLimitDialog.tsx line 59 (clipboard-only request dead end): remains resolved by 53132a4.
Previous Review Summaries (2 snapshots, latest commit 53132a4)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 53132a4)

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change adds a read-only selectable fallback for the Business usage-limit request when clipboard access fails, resolving the previously reported UX dead end with no new correctness, security, or memory-leak concerns.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (2 files changed since 3d04620)
  • DEVELOPMENT.md - no issues (documents the new clipboard-failure fallback; no images added)
  • apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.tsx - no issues (imports an existing Textarea primitive that forwards readOnly/rows/value/onFocus; error state now reveals the message and onFocus selects it; no listeners, timers, or subscriptions, so no memory-leak risk)
Prior finding resolved
  • ChatGptUsageLimitDialog.tsx line 59 (clipboard-only request dead end): resolved by commit 53132a4 - a denied clipboard write now reveals a read-only textarea with the full request, and the status text points the user to it.

Previous review (commit 3d04620)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The Business usage-limit change is well-scoped and consistent across the parser, persistence, wire schema, and UI; the only finding is a UX fallback gap in the copy-for-admin action.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.tsx 58 Business request text is clipboard-only; a failed copy leaves no way to read the message
Files Reviewed (17 files)
  • DEVELOPMENT.md - no issues (doc section placed under Cloudflare Workers & AI Inference; no images added)
  • apps/web/src/components/chatgpt/ChatGptSharedServicesCard.test.ts - no issues
  • apps/web/src/components/chatgpt/ChatGptSharedServicesCard.tsx - no issues (passes status.usageLimit.code to the dialog)
  • apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.test.ts - no issues
  • apps/web/src/components/chatgpt/ChatGptUsageLimitDialog.tsx - 1 suggestion
  • apps/web/src/components/organizations/byok/OpenAiChatGptCard.test.ts - no issues
  • apps/web/src/components/organizations/byok/OpenAiChatGptCard.tsx - no issues (passes status.usageLimit.code to the dialog)
  • apps/web/src/lib/openai-chatgpt/status.ts - no issues (additive nullable code in the output schema; server always sets it)
  • apps/web/src/routers/openai-chatgpt-router.test.ts - no issues
  • packages/db/src/migrations/0283_eager_overlord.sql - no issues (nullable ADD COLUMN, no default, no table-locking DDL)
  • packages/db/src/migrations/meta/0283_snapshot.json - generated, not reviewed
  • packages/db/src/migrations/meta/_journal.json - generated, not reviewed
  • packages/db/src/schema.ts - no issues
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/shared-services.test.ts - no issues (imports for db/and/eq/schema already present)
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/store.ts - no issues (read/record/clear/save all keep usage_limit_error_code in sync)
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/usage-limit.test.ts - no issues
  • packages/web-shared/src/lib/ai-gateway/openai-chatgpt/usage-limit.ts - no issues (preferring code over type correctly lets the specific Business marker win; still ignores rate_limit_exceeded)

Notes

  • The new code field in OpenAiChatGptStatusSchema is required, matching the sibling reachedAt/resetsAt shape; every producer (readOpenAiChatGptUsageLimit) sets it, and legacy rows read back as null, so no client break is expected.
  • No event listeners, subscriptions, or timers are introduced, so no memory-leak risk was found in the changed code.

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 40.6K · Output: 6.4K · Cached: 254.2K

Review guidance: REVIEW.md from base branch main

@iscekic

iscekic commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Verified the clipboard-denied path on the real settings page. The request field is read-only and selects its full content on focus. Restoring clipboard access lets the copy action succeed and removes the manual field. Narrow-screen geometry and visual assertions passed.

Manual admin-request copying after clipboard denial

@iscekic
iscekic added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
@iscekic

iscekic commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Merged main without rebasing and regenerated the ChatGPT migration after the migration-index collision. The new migration contains the same nullable-column addition. Drizzle reports a consistent chain and no further schema changes. A disposable PostgreSQL smoke passed: existing connections remain intact, the new column accepts null, and it stores the Business error code.

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.

2 participants