Skip to content

fix: stop lifecycle authority detection thrash#565

Merged
ogulcancelik merged 1 commit into
ogulcancelik:masterfrom
dzevs:fix/lifecycle-authority-detection-thrash
Jun 11, 2026
Merged

fix: stop lifecycle authority detection thrash#565
ogulcancelik merged 1 commit into
ogulcancelik:masterfrom
dzevs:fix/lifecycle-authority-detection-thrash

Conversation

@dzevs

@dzevs dzevs commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Refs #560.

Summary

  • make lifecycle-authority sync idempotent so repeated true -> true updates do not reset agent detection
  • skip routine pty/process probing while full lifecycle hook authority is active
  • preserve pending process-exit and release/reacquire probes
  • add regression coverage for lifecycle-authority probe gating and reset notification behavior

Root cause

For full lifecycle hook authority panes, app event handling repeatedly synced lifecycle authority into the runtime. The runtime setter notified the detection reset path on every true call, even when already active. That reset AgentDetectionPresence back to None.

The pty-first process probe then ran before the lifecycle-authority screen-detection gate and re-detected the foreground Pi process, emitting repeated None -> Some(Pi) state changes. Those state changes fed back into app event handling, creating the CPU/log/event-loop flood.

Validation

  • cargo fmt --check
  • cargo test pane::tests:: -- --nocapture
  • cargo test --bin herdr ✅ (1879 passed)
  • cargo test ✅ (unit + integration tests)
  • cargo clippy --all-targets --locked -- -D warnings

Manual verification

Tested locally with a rebuilt/installed herdr 0.6.9 binary:

  • running server binary hash matched the fixed build
  • no renewed previous_agent=None agent=Some(Pi) flood after restart
  • UI lag disappeared
  • select-to-copy worked again

Make lifecycle authority sync idempotent so repeated true-to-true updates do not reset agent detection state. Skip routine pty process probes while full lifecycle hook authority is active, preserving pending process-exit and release probes.\n\nFixes ogulcancelik#560.
@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @dzevs, thanks for your interest in contributing!

New contributors need maintainer approval before opening PRs. This keeps review time focused on accepted work and avoids wasted effort.

Herdr is opinionated about how it should look, feel, and work. Feature requests, ideas, questions, contribution proposals, and product-direction checks belong in Discussions, not issues.

Next steps:

  1. If this is a feature or behavior change, open a Discussion describing what you want to change and why
  2. If the work is accepted, a maintainer may convert the discussion into an issue or create a new issue for it
  3. If this is a reproducible bug, open a bug report using the issue template
  4. Wait for maintainer approval on an accepted issue before opening a PR
    Maintainers approve first-time PR paths with /approve @your-github-username on the accepted issue.
  5. Keep it concise and write in your own voice

A discussion, issue, branch, or proposed implementation does not reserve the work and does not mean the PR path is approved.

This PR will be closed automatically. See https://github.com/ogulcancelik/herdr/blob/master/CONTRIBUTING.md for more details.

@kangal-bot kangal-bot closed this Jun 11, 2026
@ogulcancelik ogulcancelik reopened this Jun 11, 2026
@ogulcancelik ogulcancelik merged commit f591939 into ogulcancelik:master Jun 11, 2026
7 checks passed
@ogulcancelik

Copy link
Copy Markdown
Owner

lgtm correct fix ty

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.

3 participants