Skip to content

Add React Doctor and clear GUI/src diagnostics - #140

Closed
Wibias wants to merge 4 commits into
lidge-jun:mainfrom
Wibias:chore/add-react-doctor
Closed

Wibias wants to merge 4 commits into
lidge-jun:mainfrom
Wibias:chore/add-react-doctor

Conversation

@Wibias

@Wibias Wibias commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add React Doctor for the GUI: local doctor / doctor:full scripts, changed-scope pre-push when gui/ changes, and advisory GitHub Action CI.
  • Clear React Doctor findings across the GUI (a11y, native dialogs, TanStack Query data fetching, component splits) and across src/ (perf loops/clones, Zod 4 APIs, update integrity check, related cleanups).
  • Verified clean with full-repo and GUI react-doctor scans (No issues found).

Test plan

  • bun run typecheck
  • bun test --isolate ./tests/
  • cd gui && bun run doctor:full → no issues
  • From repo root: bun x react-doctor@latest --verbose --scope full → no issues
  • Smoke GUI: open dashboard, providers, models, auth modals after Query migration
  • Confirm advisory React Doctor workflow runs on this PR without blocking merge

Wibias added 4 commits July 17, 2026 05:50
Wire doctor scripts and changed-scope pre-push when gui/ changes; keep CI advisory via react-doctor.yml scanning gui/.
Resolve GUI diagnostics (a11y, dialogs, TanStack Query, etc.) and src performance/security findings so full-repo doctor scans report clean.
Derive poll data from React Query instead of mirroring into useState via effects, and sync editable slices with render-time state adjusts.
Use a controlled clock and a wider stale window so the replacement lock is not immediately re-staled and unlinked when same-bytes rewrites leave mtime unchanged.
@lidge-jun

Copy link
Copy Markdown
Owner

Thanks for running React Doctor and collecting these improvements. For future contributions, please split tooling, query migrations, page-level UI changes, update integrity, and runtime adapter changes into separate semantic PRs; combining them makes correctness review and rollback difficult.

We are preserving your authorship and rebuilding the retained work as a small stacked-PR series based on dev. Every child PR will reference #140 and credit @Wibias. Please avoid adding unrelated changes to this branch while we split and validate it.

stack-rebuild-2026-07-17

@lidge-jun

Copy link
Copy Markdown
Owner

The rebuild of this PR has landed on dev as a reviewed stack — commits tagged pr140 rebuild WP110–WP180 (React Doctor advisory tooling, query/client foundations, per-page diagnostics across Providers/Models/Dashboard/Usage/ClaudeCode/Debug/Logs/ApiKeys/CodexAuth/Subagents, immutable update target, bounded image normalization, Cursor retry ordering). All 488 hunks were classified and carried over with authorship preserved (@Wibias as author on reconstruction commits, Co-authored-by on redesigns). Thanks for the diagnostics sweep — closing in favor of the dev stack.

@lidge-jun lidge-jun closed this Jul 18, 2026
kartikkabadi added a commit to kartikkabadi/opencodex that referenced this pull request Aug 14, 2026
Port codex-router PR lidge-jun#140: a request the provider answered cannot have
exceeded its context window, so the token estimate must never claim it
did.

estimateTokens gains an optional contextWindow cap. The request log
caps the ESTIMATE field (attempt.inputTokenEstimate and the
usage-fallback inputTokens) at the routed model's window while the
combined inputTokens field keeps its max(reported, estimate) behavior;
provider-reported positive counts are never reduced. Kiro auto and
unknown adapters/models stay uncapped - a window is never invented.

Window sources: KIRO_MODEL_CONTEXT_WINDOWS (src/providers/kiro-models.ts,
mirroring adapters/kiro.ts kiroUpstreamContextWindow) and
inferCursorContextWindow (src/adapters/cursor/discovery.ts), picked by
route adapter in request-log.ts contextWindowForModel.

Tests: extended tests/token-estimate.test.ts, added
tests/request-log-estimate-cap.test.ts, updated the one request-log
test that asserted an above-window estimate.
lidge-jun pushed a commit that referenced this pull request Aug 14, 2026
Port codex-router PR #140: a request the provider answered cannot have
exceeded its context window, so the token estimate must never claim it
did.

estimateTokens gains an optional contextWindow cap. The request log
caps the ESTIMATE field (attempt.inputTokenEstimate and the
usage-fallback inputTokens) at the routed model's window while the
combined inputTokens field keeps its max(reported, estimate) behavior;
provider-reported positive counts are never reduced. Kiro auto and
unknown adapters/models stay uncapped - a window is never invented.

Window sources: KIRO_MODEL_CONTEXT_WINDOWS (src/providers/kiro-models.ts,
mirroring adapters/kiro.ts kiroUpstreamContextWindow) and
inferCursorContextWindow (src/adapters/cursor/discovery.ts), picked by
route adapter in request-log.ts contextWindowForModel.

Tests: extended tests/token-estimate.test.ts, added
tests/request-log-estimate-cap.test.ts, updated the one request-log
test that asserted an above-window estimate.
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
Port codex-router PR lidge-jun#140: a request the provider answered cannot have
exceeded its context window, so the token estimate must never claim it
did.

estimateTokens gains an optional contextWindow cap. The request log
caps the ESTIMATE field (attempt.inputTokenEstimate and the
usage-fallback inputTokens) at the routed model's window while the
combined inputTokens field keeps its max(reported, estimate) behavior;
provider-reported positive counts are never reduced. Kiro auto and
unknown adapters/models stay uncapped - a window is never invented.

Window sources: KIRO_MODEL_CONTEXT_WINDOWS (src/providers/kiro-models.ts,
mirroring adapters/kiro.ts kiroUpstreamContextWindow) and
inferCursorContextWindow (src/adapters/cursor/discovery.ts), picked by
route adapter in request-log.ts contextWindowForModel.

Tests: extended tests/token-estimate.test.ts, added
tests/request-log-estimate-cap.test.ts, updated the one request-log
test that asserted an above-window estimate.
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