Repository navigation
Pin the Harness at f87bfbf5 and use its TokioTimer - #31
Conversation
`workshop-agents` defined the timer that each Host of Workshop sleeps on, `TokioTimer`. The Harness at `f87bfbf5` has that type in `harness-gateway-client`, so `timer.rs` is deleted and the four call sites import the type from there. The three `rev` values of `runvil-harness` in `Cargo.toml` move to `f87bfbf5`.
- `workshop_agents` exports one name fewer, and `workshop-agents` names `harness-gateway-client` as a dev-dependency for the fixture Host of its tests.
- The `tokio` dependency of `workshop-agents` loses the feature `time`, which its comment in the manifest gave to the timer. The dev-dependency gains `time`, for the deadline that the tests set on each wait.
- `run_for` in `support.rs` takes its finder from `FindTextPrompt`, where it held a closure that served one agent. It builds its setup with `has_user(true)`, where it used struct update syntax.
- The closure failed a find for another name with the message `no agent named {name}`. The stock finder now answers such a find, and no assertion changes with it.
- The `new` of `AgentSessions` builds its `Host` inside the `Arc`, where it built the `Host` first and wrapped it as it filled `Inner`.
- The module doc of `agents.rs` said that the setup of a run takes the granted roots of the workspace beside the pick of the menu. It now names the pick alone. The diff changes only that sentence for it, and no code.
- `Cargo.lock` changes its 14 `source` lines of the Harness packages and gains one line, the new dependency of `workshop-agents`.
- No test is added or removed.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The pinned upstream implementation is unavailable in this snapshot, so approval requires confirming that cppalliance/runvil-harness#59 has merged and verifying the replacement timer’s contract.
No open issues 🎉
What changed in this PR
Workshop replaces its local timer with the Harness-provided TokioTimer, pinning the Harness at f87bfbf5. This PR depends on cppalliance/runvil-harness#59 merging first.
Changes:
- Update the three Harness dependency pins and corresponding lockfile entries.
- Remove Workshop’s timer implementation and use
harness_gateway_client::TokioTimerin production and tests. - Simplify Host and test setup, and correct stale documentation about workspace roots removed in #29.
| File | Description |
|---|---|
crates/workshop/server/src/agents/tests.rs |
Import the Harness timer for server tests. |
crates/workshop/server/src/agents.rs |
Use the Harness timer, simplify Host construction, and update documentation. |
crates/workshop/agents/tests/it/support.rs |
Use the Harness timer and simplify fixture setup. |
crates/workshop/agents/src/timer.rs |
Delete the local timer implementation. |
crates/workshop/agents/src/lib.rs |
Remove the timer export and update crate documentation. |
crates/workshop/agents/Cargo.toml |
Add the test timer dependency and move Tokio’s time feature to dev-dependencies. |
Cargo.toml |
Pin all three Harness dependencies to the same new commit. |
Cargo.lock |
Record the updated Harness sources and agents test dependency. |
Review effort: Balanced
Workshop stops defining its own tokio timer and uses the one the Harness now has,
harness_gateway_client::TokioTimer. To get it, Workshop pins the Harness atf87bfbf5, a commit of cppalliance/runvil-harness#59. Two later commits of that pull request change text only, so the pin holds all of its code.Merge order: this pull request merges after cppalliance/runvil-harness#59. Its pin names a commit that only that pull request holds until then. The Harness merge is a fast-forward, so the commit keeps its id.
The commit
f87bfbf5and use itsTokioTimer. The threerevvalues ofrunvil-harnessinCargo.tomlmove,workshop-agentsloses its timer, and the four call sites take the stock one.What changes
crates/workshop/agents/src/timer.rsis deleted, andworkshop_agentsexports one name fewer.workshop-agentsnamesharness-gateway-clientas a dev-dependency, for the fixture Host of its tests. Itstokiodependency loses thetimefeature, which only the timer used, and the dev-dependency gains it for the deadlines of the tests.workshop-serverimportsTokioTimerfromharness_gateway_client, a crate that it depended on already.Cargo.lockchanges its 14sourcelines of the Harness packages and gains one line, the new dependency ofworkshop-agents.TokioTimer, and two use it in the Harness's own tests and example. So the type is the one change to the Harness API.Call sites
Each function that changed its timer was also left in the shortest form that the API allows:
run_forin the tests ofworkshop-agentsheld an eleven-line closure that served one agent, and a setup in struct update syntax. It now usesFindTextPromptandRunSetup::new(..).has_user(true).AgentSessions::newbuilds itsHostinside theArc.run_prompt_overand the test ofexecutein the server's tests changed their import alone. The first has a one-line finder that serves its source under every name, and the second usesagent_finder, the code under test.One correction beside the timer
The module doc of
crates/workshop/server/src/agents.rsstill said that a run's setup takes the granted roots of the workspace. #29 removed the roots and left that sentence behind. It now names the menu's pick alone.Tests
The two test groups run 706 and 353 tests on Windows, all passing, the same counts as before. No test is added or removed, and no assertion changes.
Checks
Every command in
AGENTS.mdpassed on the new pin, with--locked: the format check, clippy in its two groups withCARGO_BUILD_WARNINGS=deny, nextest in its two groups, the docs build withRUSTDOCFLAGS="-D warnings",cargo dylint, the structural checks, and the wording scan. The pre-push hook passed on the push.The checks ran on Windows.
Summary by CodeRabbit