Skip to content

fix(cli): doctor ledger lock, catalog timeout and host check; sibling watcher starts at the log end - #401

Merged
ajianaz merged 1 commit into
developfrom
fix/doctor-sibling-followups
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/doctor-sibling-followups

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Follow-ups from the cora 0.19.0 agent-reviewer scan (the doctor and sibling findings, verified against the code) plus the three guarded unwraps cora reported.

Why

  • Concurrent tole doctor runs could overwrite each other's ledger entry (unlocked load/record/save) and race on the temp file.
  • The catalog tier reused the ACP model picker's 3 s probe timeout, so a slow but healthy gateway showed up as a release-gate blocker.
  • base_url_ok accepted URLs without a host (https://?x).
  • Every child agent folded the whole shared touch log (all earlier children's history) on start-up.

Changes

  • doctor.rs: Ledger::update holds an exclusive advisory flock on doctor-ledger.json.lock (owner-only) across load/record/save, the same pattern as the agents-root lock (no lock on non-unix, single writer). The catalog tier uses CATALOG_TIMEOUT = 20 s. base_url_ok requires a host after any userinfo and before /, ?, #.
  • openai.rs (tole-core, additive): fetch_model_ids_with_timeout; fetch_model_ids keeps its 3 s behaviour for the picker.
  • sibling_watch.rs: SiblingWatcher::from_end starts at the last line boundary (reads only the tail; a half-written last line is read once complete). tole-cli uses it for the child watcher.
  • main.rs, session_host.rs: if let Some(search) = WebSearchTool::from_env() instead of is_some() + unwrap().
  • CHANGELOG.

Testing

  • New tests: concurrent ledger updates from 8 threads keep all 8 entries (fails 3/3 with the lock removed, passes with it); base URL host matrix; from_end skips history but sees later activity, and waits for a half-written last line.
  • fmt, clippy -D warnings, cargo test --workspace, cargo check --no-default-features (core and cli) pass; cora review --staged clean.

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit d6cbf20 into develop Oct 16, 2026
17 checks passed
@ajianaz
ajianaz deleted the fix/doctor-sibling-followups branch October 16, 2026 09:10
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