Skip to content

fix: preserve models and reject exiting dispatch leaders - #2497

Merged
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/fix-telemetry-config-compat
Aug 25, 2026
Merged

fix: preserve models and reject exiting dispatch leaders#2497
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/fix-telemetry-config-compat

Conversation

@limityan

@limityan limityan commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • normalize unsupported non-boolean app.telemetry values to false before typed configuration deserialization
  • preserve configured AI models through compatibility recovery and reuse the existing startup backup path
  • reject macOS dispatch leaders that ps reports as exiting before SIGKILL escalation

Configuration compatibility root cause

Older builds deserialize app.telemetry as a boolean. A configuration written with the newer structured telemetry shape fails typed deserialization; the smart merge preserves that incompatible object, fails again, and activates in-memory defaults. The model configuration remains on disk but appears empty in the running application.

Input Result
Boolean app.telemetry Preserved unchanged
Object or other non-boolean value Original configuration is backed up, then the legacy field is persisted as false
Unsupported newer schema version Existing fail-closed schema handling remains unchanged

macOS cancellation root cause

The failing CLI test exposed a real exit-window race. kill(pid, 0) still observes an exiting leader, while macOS ps adds the E modifier when a process is trying to exit. The previous zombie-only check accepted states such as SE and UEs, re-authenticated the leader, and allowed SIGKILL escalation after SIGTERM had already caused it to exit.

The fix accepts only known live primary states (I, R, S, T, U) without the E modifier. Empty, zombie, exiting, and unknown states fail closed. Signal ordering and timeout behavior are unchanged.

The identical failure also occurred on main in CI run 32746613875, before this PR, and recurred in this PR's run 32842242028. This PR now carries the root-cause fix instead of relying on a rerun.

Verification

  • pnpm run fmt:rs
  • cargo test -p bitfun-core --no-default-features --lib service::config — 93 passed
  • cargo test -p bitfun-cli --bin bitfun macos_ -- --nocapture — 3 passed
  • cargo test -p bitfun-cli --bin bitfun dispatch::runner::tests -- --nocapture — 6 passed on Windows; Unix-specific process tests are exercised by CI
  • cargo test -p bitfun-cli --bin bitfun — 682 passed on Windows
  • git diff --check

@limityan limityan changed the title fix(config): preserve models with newer telemetry settings fix: preserve models and reject exiting dispatch leaders Aug 25, 2026
@limityan
limityan merged commit eadedad into GCWing:main Aug 25, 2026
12 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