Skip to content

fix(core): reap channels and streamline control dispatch - #78

Open
LukasParke wants to merge 1 commit into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-runtime-efficiency
Open

fix(core): reap channels and streamline control dispatch#78
LukasParke wants to merge 1 commit into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-runtime-efficiency

Conversation

@LukasParke

Copy link
Copy Markdown
Collaborator

What

  • reap idle channel state without dropping buffered values, waiters, senders, or live subscribers
  • build one frozen loop-history snapshot per iteration
  • replace random park jitter with deterministic step-id/iteration jitter
  • inline dispatch only for the bare ephemeral in-memory subprocess adapter

Why

Per-delegation channels accumulated for the harness lifetime, loop snapshots recopied history for each predicate, random jitter made replay nondeterministic, and ephemeral in-memory dispatch paid a handle round trip with nothing durable observing it.

This semantically ports the item-11 portion of fork/port/openrouter-fixes commit 27ddda8e onto current names. It deliberately excludes #69 EventBroadcaster and generator-yield behavior.

Test plan

  • 98 focused channel/control/subprocess tests pass
  • core/types typechecks
  • root lint
  • sentrux check .
  • sentrux gate .
  • source worker full core suite — 1,462 pass
  • clean-context Pi review; fixed parked-stream reap order and narrowed inline eligibility

Compatibility

The default ephemeral in-memory adapter may dispatch nested steps inline. Adapters with storage or custom hooks continue through spawn().

Port the non-PR69 runtime efficiency and reliability changes from fork/port/openrouter-fixes commit 27ddda8: channel reaping, shared loop snapshots, deterministic park jitter, and safe inline dispatch.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@LukasParke is attempting to deploy a commit to the Matt Apperson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@LukasParke

Copy link
Copy Markdown
Collaborator Author

Agent: Code CI/structural/DCO are green where configured; remaining external red checks are compat with an empty upstream OPENROUTER_API_KEY and Vercel authorization. Where core CI is red, the only failure is the unrelated timing-sensitive executeRunCode retry-backoff test; affected local/full suites passed. I cannot rerun upstream Actions without admin rights.

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