Skip to content

Restore compact model forwarding settings#296

Open
OLuckyO wants to merge 1 commit into
qxcnm:mainfrom
OLuckyO:codex/restore-compact-model-forward-settings
Open

Restore compact model forwarding settings#296
OLuckyO wants to merge 1 commit into
qxcnm:mainfrom
OLuckyO:codex/restore-compact-model-forward-settings

Conversation

@OLuckyO
Copy link
Copy Markdown
Contributor

@OLuckyO OLuckyO commented Jun 2, 2026

Restores the compact model forwarding rules editor in Settings so persisted compactModelForwardRules can be reviewed and updated.

Copilot AI review requested due to automatic review settings June 2, 2026 02:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support in the admin settings UI for configuring “compact” model forwarding rules (for /v1/responses/compact) alongside the existing model forward rules.

Changes:

  • Introduces new draft state and normalization for compactModelForwardRules.
  • Adds update/commit handlers to persist compactModelForwardRules to settings.
  • Adds a new ModelForwardRulesEditor section for compact routing rules in the Settings page.
Comments suppressed due to low confidence (1)

apps/src/app/settings/page.tsx:2

  • Normalization is applied redundantly: updateCompactModelForwardRuleRows already calls ensureModelForwardRuleRows(sourceRows) before invoking the updater, but onRowsChange wraps the updater with another ensureModelForwardRuleRows(updater(rows)). This duplication makes it harder to reason about invariants and can add unnecessary work. Centralize normalization in one place (preferably inside updateCompactModelForwardRuleRows) and have onRowsChange pass the updater through directly. Also consider ensuring rows right before serialization in commitCompactModelForwardRulesDraft to guarantee the persisted format is normalized even if future callers update the draft without ensuring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +776 to +781
const sourceRows =
compactModelForwardRuleRowsDraft ??
parseModelForwardRules(snapshot?.compactModelForwardRules || "");
setCompactModelForwardRuleRowsDraft(
updater(ensureModelForwardRuleRows(sourceRows)),
);
Comment thread apps/src/app/settings/page.tsx
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