Skip to content

[codex] Break web composer circular dependency#1659

Open
PlunderStruck wants to merge 2 commits intopingdotgg:mainfrom
PlunderStruck:codex/fix-web-circular-deps
Open

[codex] Break web composer circular dependency#1659
PlunderStruck wants to merge 2 commits intopingdotgg:mainfrom
PlunderStruck:codex/fix-web-circular-deps

Conversation

@PlunderStruck
Copy link
Copy Markdown

@PlunderStruck PlunderStruck commented Apr 1, 2026

What changed

  • extracted the pure composer provider-state normalization into apps/web/src/composerProviderState.ts
  • updated non-UI callers to import the pure helper directly
  • trimmed composerProviderRegistry.tsx back to traits rendering only
  • added a markdown checklist plan at docs/web-circular-deps-plan.md

Why

  • ctx-analysis.md and the live dependency graph both identified a real web import cycle through composerDraftStore.ts, modelSelection.ts, composerProviderRegistry.tsx, and TraitsPicker.tsx
  • the cycle made modelSelection.ts pull chat UI and store setup into non-UI code paths

Impact

  • removes the web circular dependency while keeping composer behavior unchanged
  • leaves the remaining contracts cycle untouched because it is still the separate type-coupling issue we discussed

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test
  • refreshed SocratiCode graph: only the contracts cycle remains
  • refreshed SCIP index: modelSelection.ts now depends on composerProviderState.ts instead of the chat registry

Note

Break circular dependency by extracting getComposerProviderState into a standalone module

Macroscope summarized 5415598.


Note

Low Risk
Low risk refactor that primarily moves provider-state normalization into a standalone module; main risk is subtle behavioral drift in model option normalization or ultrathink styling if the extraction missed edge cases.

Overview
Breaks a web circular dependency by extracting the pure composer provider-state normalization (getComposerProviderState and related types) into a new apps/web/src/composerProviderState.ts module.

Updates non-UI callers (modelSelection.ts, ChatView.tsx) to import the new helper directly, and trims composerProviderRegistry.tsx down to traits UI rendering only. Provider-state tests are repointed to the new module, and a new docs/web-circular-deps-plan.md documents the dependency cycle and verification steps.

Written by Cursor Bugbot for commit 5415598. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5c527875-f2b4-4ee7-9efe-78a49bfe624a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 1, 2026
@PlunderStruck PlunderStruck marked this pull request as ready for review April 1, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant