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.

@BigPizzaV3

Copy link
Copy Markdown
Owner

请解决冲突

@chenbai365

Copy link
Copy Markdown

👋 @ 感谢贡献!此 PR 已开放 22 天,且当前存在 合并冲突 (merge conflict)

请 rebase 到最新的 main 分支并解决冲突。若 7 天内未更新,我们将关闭此 PR。

如有任何问题,欢迎在评论区讨论。

@chenbai365

Copy link
Copy Markdown

此 PR 已开放 22 天且存在合并冲突未解决,现予以关闭。

如需继续,请 rebase 到最新 main 后重新打开(reopen)即可。

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.

3 participants