Repository navigation
fix(examples): run task_live standalone on Tiny Humans' routes - #75
Conversation
The module claims its bus name while its setup is still running, and the loader refuses a reconfiguration until that setup returns. Host::load reconfigured as soon as the name appeared, so task_live could fail at once with "module must be ready before reinitialization" (seen on macOS). It now waits for the loader to report the module ready, and names the state the module stopped in when it never gets there.
TINYHUMANS_TOKEN, a Tiny Humans bearer (a session token, or an API key with the inference scope), sends Jev and the planner through Tiny Humans' routes in place of OPENROUTER_API_KEY. The gateway refuses the engine's OpenRouter model ids, so agentic-v1 plans, rescues and shapes unless a model variable names another. Sage still takes the decisions on either route when asked. TASK_HEADED=1 shows the browser the task launches, for a host run someone wants to watch. The routes are read through a variable lookup, so they are tested without touching the process environment.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (6)
Comment |
Tiny Sweeper reviewTiny Sweeper reviewed this change across 6 lane(s) and found 1 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Ready for maintainer review Review snapshot
Completeness: Complete What changedThe review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below. FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. Findings
Before mergeNone. How this fits togetherflowchart LR
n0["main<br/>changed"]:::changed
n1["module_config<br/>changed"]:::changed
n2["plan<br/>changed"]:::changed
n3["Host<br/>changed<br/>1 finding"]:::flagged
n4["wait_for_module<br/>changed<br/>1 finding"]:::flagged
n5["LabError"]:::impacted
n6["env"]:::impacted
n7["Value"]:::impacted
n8["Err"]:::impacted
n9["data"]:::impacted
n10["other"]:::impacted
n0 -->|calls| n1
n0 -->|calls| n2
n0 -->|uses| n5
n0 -->|calls| n6
n0 -->|uses| n6
n0 -->|calls| n8
n1 -->|uses| n5
n1 -->|uses| n6
n1 -->|uses| n7
n2 -->|uses| n3
n2 -->|uses| n5
n4 -->|uses| n5
n4 -->|calls| n10
n9 -->|uses| n5
n9 -->|calls| n8
n9 -->|calls| n10
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.0027 · 157,566 in / 9,213 out · 12,152 cached (8%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0009 · 74,577 in / 3,996 out · 8,314 cached (11%) · gpt-5.6-luna, glm-5.3-flash
security: $0.0005 · 42,571 in / 1,419 out · 3,774 cached (9%) · gpt-5.6-luna
tests: $0.0002 · 20,583 in / 1,523 out · 0 cached (0%) · glm-5.3-flash
description: $0.0001 · 10,451 in / 187 out · 64 cached (1%) · glm-5.3-flash
| /// Waits until the loader reports the module ready for calls. The module | ||
| /// claims its bus name while its setup is still running, and the loader | ||
| /// refuses a reconfiguration until that setup has returned. | ||
| async fn wait_until_ready(module_host: &ModuleHost) -> Result<(), LabError> { |
There was a problem hiding this comment.
Test wait_until_ready's failure paths, not just its comment
This new function is the behavioural heart of the host-side change: the comment claims the loader refuses reconfiguration until setup returns, and the code asserts that claim only in prose. Its three outcomes — returning Ok on ModuleState::Ready | ModuleState::Serving, returning a descriptive error on Rejected | Unresolved | Faulted | Failed | Stopped | Disabled, and the 30-second timeout — are exercised by no test in the diff, and the repository requires failure paths to be covered and at least 90% line coverage per source file. A regression that flips the match arms (e.g. treating Faulted as retryable, or timing out instantly) would ship silently. If constructing a ModuleHost in a test is impractical, at minimum factor the state-classification into a pure function over Option<ModuleState> and test that.
[RULE] untested-error-path ·
Summary
Two things stopped
task_livefrom running on its own on a Mac.Host::loadreconfigured as soon as the name appeared, so everytask_liverun failed straight away withmodule must be ready before reinitialization. It now waits until the loader reports the module ready. If the module ends in a terminal state instead, the error names that state.task_live.TINYHUMANS_TOKENcan replaceOPENROUTER_API_KEY. It takes a Tiny Humans session token, or an API key with theinferencescope. With it set, Jev goes throughtiny_humans_open_routerand the planner through thetiny_humansgateway.agentic-v1plans, rescues and shapes unless a model variable names another model.TASK_HEADED=1shows the launched browser, for a run on the host that someone wants to watch.Related issue
None in this repo. Found while running tinycomputer standalone for tinyhumansai/openhuman#7000.
API or behavior changes
None for the module; the changes are to the examples only.
task_livegains two optional env vars,TINYHUMANS_TOKENandTASK_HEADED.OPENROUTER_API_KEYandTINYHUMANS_TOKEN.Validation
Commands actually run, on macOS (arm64):
cargo fmt --all -- --check: passcargo clippy --all-targets --all-features -- -D warnings: pass, run as-p tinycomputer-examples -p tinycomputer-enginecargo build --all-targets --all-features: not run as its own step. The clippy and test builds cover the changed crate, and the release build oftask_livesucceeded.cargo test --all-features -p tinycomputer-examples: 36 passed, 0 failedLive runs:
TINYHUMANS_TOKEN(a prod API key) planned, ran and printedPASS: "list the top 3 stories on news.ycombinator.com", 19 s headed and 28 s headless.Tests
task_live/main_tests.rsis new. It covers:agentic-v1defaults;The routes are read through a variable lookup, so the tests never touch the process environment.
The host's ready-wait is only exercised by the live runs above, because it needs a loaded module.
Documentation
.env.exampledocs/crates/tinycomputer-examples/live-tasks.mddocs/crates/tinycomputer-examples/running-the-examples.mdChecklist
task_livestandalone. The two commits can be reviewed separately.#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description