Skip to content

fix(overseer): decouple meta-thread health from isolated act() errors (#4080) - #4214

Merged
rysweet merged 1 commit into
mainfrom
feat/issue-4080-nodeoptions-max-old-space-size32768-saved-preferen
Jul 16, 2026
Merged

fix(overseer): decouple meta-thread health from isolated act() errors (#4080)#4214
rysweet merged 1 commit into
mainfrom
feat/issue-4080-nodeoptions-max-old-space-size32768-saved-preferen

Conversation

@rysweet

@rysweet rysweet commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Problem (#4080)

The primary overseer meta-thread reported erroring at its last tick even though it was still intervening normally. Root cause: the daemon derived the meta-thread's last_success from !report.panicked && report.errors == 0, so a single transient per-intervention act() failure — explicitly documented as "isolated, never fatal" — pinned the thread in "erroring", and a later healthy tick never cleared it.

Fix (additive / non-breaking)

  • Add cycle_failed: bool to OverseerTickReport, set only when the tick's OODA cycle itself fails (run_cycle() returns Err, or the tick panics — which also sets panicked).
  • Daemon now derives meta-thread health from !panicked && !cycle_failed. Isolated act() errors are still counted in errors (feed/totals visibility) but no longer drive health.
  • Health is recomputed fresh each tick, so the first clean tick flips erroring → ok automatically — no latched-flag reset needed.
  • #[serde(default)] covers the new field: legacy feed records deserialize with cycle_failed = false; no SCHEMA_VERSION bump.
  • cycle_failed added to structured tracing + the daemon log line for observability.

Tests

Regression coverage in src/overseer/wiring.rs and src/overseer/activity.rs:

  • isolated act() error → cycle_failed = false → meta-thread stays ok (the erroring→ok recovery path)
  • run_cycle() Err → cycle_failed = trueerroring
  • panic → panicked + cycle_failederroring
  • legacy JSON without the field deserializes to false

Verification

  • cargo test --lib overseer — 489 passed
  • pre-commit: cargo fmt --check, cargo clippy --release -D warnings — pass
  • pre-push: full test suite + cargo clippy --all-targets --all-features -D warnings — pass

Additive / non-breaking; PRD preserved; no Bridge naming; structured tracing + OpenTelemetry only, no stray print!/println!.

Closes #4080

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…#4080)

The daemon derived the overseer meta-thread's `last_success` from
`!panicked && report.errors == 0`, so a single transient per-intervention
`act()` failure — documented as "isolated, never fatal" — pinned the
meta-thread in "erroring", and a later healthy tick never cleared it.

Add an additive `cycle_failed: bool` to `OverseerTickReport` that is set
ONLY when the tick's OODA cycle itself fails (`run_cycle()` returns Err or
the tick panics). Health is now derived from `!panicked && !cycle_failed`,
so isolated act() errors are still counted in `errors` for feed visibility
but no longer drive health. Because health is recomputed fresh each tick,
the first clean tick flips the row from "erroring" back to "ok".

- additive, `#[serde(default)]` — legacy feed records default to false, no
  SCHEMA_VERSION bump
- structured tracing + daemon log now emit `cycle_failed`
- regression tests cover erroring→ok recovery, run_cycle Err, panic, and
  legacy deserialization

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

📊 Coverage Summary

Generated by cargo llvm-cov --workspace --summary-only (nightly, excluding test files)

Module Lines Covered Coverage
Total 182882 152630 83.5%

Coverage data from CI run. Test files matching tests?/ are excluded from line counts.

@rysweet
rysweet merged commit ba87ae3 into main Jul 16, 2026
16 checks passed
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