Skip to content

Refactor request completion and plot image ordering#52

Merged
t-kalinowski merged 4 commits intomainfrom
refactor-server-backend-boundary
May 7, 2026
Merged

Refactor request completion and plot image ordering#52
t-kalinowski merged 4 commits intomainfrom
refactor-server-backend-boundary

Conversation

@t-kalinowski
Copy link
Copy Markdown
Member

@t-kalinowski t-kalinowski commented May 7, 2026

Summary

Refactors the server/backend boundary for request completion and plot image ordering. The branch removes the worker-owned request_end sideband message, uses worker-declared client-waiting prompt events as the completion signal, and keeps response image identity/update grouping owned by the server.

Public-facing changes:

  • No MCP tool schema changes.
  • Tightens visible reply ordering for flushed text before plot image events.

Internal-only changes:

  • Removes request_end from the worker-to-server sideband protocol.
  • Keeps plot image sideband messages one-way; workers do not receive plot-image acknowledgements and must not gate stdout/stderr on sideband responses.
  • Makes response image IDs server-owned while allowing workers to provide optional plot source identity.
  • Prevents stale disclosed image-bundle anchors from replaying before fresh follow-up replies.
  • Keeps explicit repeated Python plot() and show() calls image-producing while preserving quiet no-op requests.
  • Surfaces strict IPC parse failures as disconnects instead of hidden backend-info or request-completion timeouts.
  • Adds manual workflow_dispatch support to CI.
  • Documents remaining server/backend boundary follow-up work.

Diff composition

Measured against main, this PR is 1896 insertions and 460 deletions across 32 files.

  • runtime src/: +839/-315 (49.0% of churn)
  • inline tests inside src/: +424/-54 (20.3% of churn)
  • tests in tests/: +433/-22 (19.3% of churn)
  • docs: +105/-27 (5.6% of churn)
  • snapshots: +24/-0 (1.0% of churn)
  • other: +71/-42 (4.8% of churn)

Largest files:

  • src/ipc.rs: +514/-169
  • src/worker_process.rs: +325/-111
  • tests/python_plot_images.rs: +224/-0
  • src/output_timeline.rs: +141/-39
  • src/pending_output_tape.rs: +139/-14

Testing

  • cargo +nightly fmt
  • cargo check
  • cargo build
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test
  • codex review --base main

@t-kalinowski t-kalinowski marked this pull request as draft May 7, 2026 11:58
@t-kalinowski t-kalinowski force-pushed the refactor-server-backend-boundary branch 2 times, most recently from 4c991c4 to bcc805c Compare May 7, 2026 14:48
Move request completion, sideband state, and worker lifecycle bookkeeping toward
the server-owned IPC boundary so backend runtimes report structured events
without owning response finalization.

Validation: cargo check; cargo build; cargo clippy --all-targets
--all-features -- -D warnings; cargo test; cargo +nightly fmt.
Route plot image updates, echo carryover, prompts, and stdout through the
timeline so mixed text/image replies keep their visible order across immediate,
timed-out, and final-response paths.

Validation: cargo check; cargo build; cargo clippy --all-targets
--all-features -- -D warnings; cargo test; cargo +nightly fmt.
Keep buffered prompts from triggering Python completion, report idle completion
consistently, emit repeated plot images explicitly, and disconnect workers that
send invalid sideband messages.

Validation: cargo check; cargo build; cargo clippy --all-targets
--all-features -- -D warnings; cargo test; cargo +nightly fmt.
Add manual CI dispatch coverage and tighten tests that depend on platform
prompts, sandbox timing, explicit plot ordering, and stale bundle replay.

Validation: cargo check; cargo build; cargo clippy --all-targets
--all-features -- -D warnings; cargo test; cargo +nightly fmt.
@t-kalinowski t-kalinowski force-pushed the refactor-server-backend-boundary branch from bcc805c to d901a12 Compare May 7, 2026 15:05
@t-kalinowski t-kalinowski marked this pull request as ready for review May 7, 2026 15:30
@t-kalinowski t-kalinowski merged commit ddc60c2 into main May 7, 2026
5 checks passed
@t-kalinowski t-kalinowski deleted the refactor-server-backend-boundary branch May 7, 2026 15:30
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