Skip to content

0.5.0: run on nagoya, with the reactor passed in - #37

Merged
pathscale merged 1 commit into
masterfrom
feat/nagoya
Sep 23, 2026
Merged

pathscale merged 1 commit into
masterfrom
feat/nagoya

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Releases 0.5.0. The crate moves from tokio to nagoya, taking the reactor by injection. This is what lets agency-proxy drop tokio.

  • Processes come from nagoya::process (0.1.12: nagoya::process, and a local-reactor timer wake fix nagoya#15), channels from futures, and timers from nagoya.
  • Breaking: every entry point that spawns a CLI takes &nagoya::reactor::Handle. That is run, stream, interrupt, Probe::run, Probe::run_bin, AuthStatus::check, AuthStatus::check_bin, Agent::account_usage and Agent::discover_models. Nothing creates a reactor or holds one in a static; the caller owns it. nagoya is re-exported.
  • Fixed on the way. Both behaviours were hidden by tokio's scheduler:
    • Cancel and close receivers are fused. A futures oneshot reads as finished once its sender drops, which is how cancel is signalled, so without the fuse cancelling would hang until the agent exited.
    • A closed control channel no longer spins the Codex and Grok drivers.
  • A driver panic is still Error::Interrupted: it is caught inside the task, because nagoya rethrows a task's panic in whoever awaits it.

Checked locally against nagoya 0.1.12:

  • cargo clippy --all-targets -D warnings is clean.
  • 229 unit tests pass, and so do the 7 tests/process.rs tests (kill, cancel and process-group teardown with fake agents), plus the doctests.
  • cargo tree -i tokio finds nothing, dev-dependencies included.

Two tests/live.rs checks fail on this machine, and neither is the migration. Both spawned the real CLIs through nagoya and read their output:

  • installed_agents_match_the_versions_the_flags_were_verified_against: the installed claude is 2.1.267, against 2.1.220 verified.
  • the_codex_catalogue_still_matches_what_codex_reports: codex reports a new model list.

Updating those means re-verifying the flags against the real CLIs, which is its own change.

tokio was the last runtime this crate tied its consumers to: agency-proxy could
not leave tokio while every provider CLI was spawned through tokio::process.
Processes now come from nagoya::process, channels from futures, timers from
nagoya, and every entry point that spawns a CLI takes the reactor Handle it
registers on. Nothing in the crate creates a reactor or keeps one in a static;
the caller owns it, and each test starts its own.

That is a public API change, so 0.5.0: run, stream, interrupt, Probe::run,
Probe::run_bin, AuthStatus::check, AuthStatus::check_bin,
Agent::account_usage and Agent::discover_models take `&Handle`. `nagoya` is
re-exported so a caller does not need a second copy of it.

Two behaviours tokio's scheduler had been hiding are fixed on the way. A
futures oneshot receiver counts as finished once its sender drops, which is
exactly how cancel is signalled, so the cancel and close arms are fused or
cancelling would hang until the agent exited. And a closed control channel no
longer spins the Codex and Grok drivers, which futures has no budget to
interrupt. A panic in a spawned driver is still Error::Interrupted, caught
inside the task because nagoya rethrows it in whoever awaits.
@pathscale
pathscale merged commit ce18d15 into master Sep 23, 2026
1 check passed
@pathscale
pathscale deleted the feat/nagoya branch September 23, 2026 14:25
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