0.5.0: run on nagoya, with the reactor passed in - #37
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Releases 0.5.0. The crate moves from tokio to nagoya, taking the reactor by injection. This is what lets agency-proxy drop tokio.
nagoya::process(0.1.12: nagoya::process, and a local-reactor timer wake fix nagoya#15), channels fromfutures, and timers fromnagoya.&nagoya::reactor::Handle. That isrun,stream,interrupt,Probe::run,Probe::run_bin,AuthStatus::check,AuthStatus::check_bin,Agent::account_usageandAgent::discover_models. Nothing creates a reactor or holds one in a static; the caller owns it.nagoyais re-exported.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 warningsis clean.tests/process.rstests (kill, cancel and process-group teardown with fake agents), plus the doctests.cargo tree -i tokiofinds nothing, dev-dependencies included.Two
tests/live.rschecks 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 installedclaudeis 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.