Skip to content

refactor(server): decompose worker request processing#551

Open
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/refactor-worker-loop
Open

refactor(server): decompose worker request processing#551
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/refactor-worker-loop

Conversation

@Graffioh

@Graffioh Graffioh commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reduce worker_loop() to dequeueing and delegate one request lifecycle to process_job().
  • Extract FlowKV, whole-prompt PFlash, upstream forwarding, cache/snapshot lifecycle, generation setup, token I/O, and API-specific response serialization into focused helpers.
  • Keep cache/decode state together where splitting it further would add more plumbing than clarity.

Example

Prompt compression changes now stay in apply_flowkv_compression() or apply_pflash_compression() instead of sharing a 1,500-line worker with cache restore, decoding, and response construction.

This is a behavior-preserving refactor; request and response formats are unchanged.

Testing

  • git diff --check
  • Unit test pass

Review in cubic

@Graffioh
Graffioh force-pushed the codex/refactor-worker-loop branch from 6050c8d to 2d136ff Compare July 20, 2026 18:59
@Graffioh
Graffioh force-pushed the codex/refactor-worker-loop branch from 2d136ff to 1cc5ff7 Compare July 20, 2026 19:18
@Graffioh
Graffioh marked this pull request as ready for review July 21, 2026 07:01

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Not reviewed (too large): server/src/server/http_server.cpp (~2,873 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Re-trigger cubic

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