Skip to content

fix: reduce sidebar polling and replay relay history#543

Open
Chenzr888 wants to merge 1 commit into
BigPizzaV3:mainfrom
Chenzr888:fix/sidebar-sort-and-relay-history
Open

fix: reduce sidebar polling and replay relay history#543
Chenzr888 wants to merge 1 commit into
BigPizzaV3:mainfrom
Chenzr888:fix/sidebar-sort-and-relay-history

Conversation

@Chenzr888
Copy link
Copy Markdown

Hi! Thanks for building Codex++. I ran into two user-visible issues while using v1.1.9 locally and wanted to contribute a small patch instead of only reporting the problem.

What this changes

  • Stops the sidebar chat sort correction from running as a continuous idle polling loop. It now runs when sidebar scans/project moves schedule it, then stops until the next relevant change. This should reduce main-thread work when the left sidebar has many conversations and make scrolling/clicking/typing feel smoother.
  • Adds a bounded in-memory history cache for the Responses-to-Chat-Completions relay proxy. When Codex sends a follow-up request with previous_response_id, the proxy now replays the prior chat messages before sending the next Chat Completions request, which helps relay mode preserve multi-turn context.
  • Records both non-streaming and streaming converted responses into that history cache.
  • Adds targeted tests/assertions for the event-driven sidebar sort behavior and previous_response_id replay.

Why

On my machine, Codex itself stays responsive, while Codex++ v1.1.9 can become very slow in the left conversation sidebar. The injected projectMove sorting path was doing recurring full visible-chat checks even while idle, so this PR keeps the feature but removes the recurring self-schedule.

For relay mode, Responses API requests can rely on previous_response_id, while Chat Completions upstreams are stateless. Replaying the local converted history makes that bridge closer to Codex's expected multi-turn behavior.

Verification

  • node --check assets/inject/renderer-inject.js
  • git diff --check

I could not run Rust tests locally because this machine does not currently have cargo installed. The PR includes Rust tests for the protocol proxy and should be covered by the existing cargo test --workspace CI.

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