Repository navigation
Conversation
…ater Detection assumed a self-updated binary was replaced in place, the shape that keeps its name and only gains Linux's " (deleted)" decoration. omp's updater cannot write over a running executable, so it renames it aside -- omp.<mtime-ms>.<pid>.<attempt>.bak -- and every probe keeps reporting the renamed path until the process exits. The basename then reaches no manifest alias (R1 dead), and the contract's recorded leader path stops matching the observed one, so a live emitter looks gone (R2 dead); a pane whose contract was retired by a shell tool's OSC 133;A and that is not running a command right now (waiting on a background job) falls out of the registry entirely, dropping its sidebar row and agent state. normalize_executable_path now collapses the trailing stamp as well, in the same place and for the same two consumers: identification sees the agent's real basename again, and leader-path equality stays true across the update. A stamp must be dot-separated digit groups before a .bak, and the surviving basename must still carry a letter, so foo.bak and version-style launcher names keep theirs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observed live: an omp session that had run for hours silently lost its sidebar row and agent state after omp self-updated mid-session. The pane was still alive, its OSC title still carried the working spinner, and `cli agent list` no longer named it.
Root cause
Agent detection paths a leader's executable through `normalize_executable_path`, which was built for one update shape: replaced in place, where the name survives and Linux only adds `" (deleted)"`. omp's updater cannot write over a running executable, so it uses the second shape: rename aside to `omp....bak`, and the running process reports that path until it exits. Both consumers of the normalized path then fail:
A pane riding only those two signals falls out of the registry entirely, and eviction is also what clears its OSC evidence, so the manifest's `π ` title rules -- which could have carried it -- never get a chance to run. The panes that kept their rows were the ones with luckier fallbacks at that moment (an active shell-command report, or a contract re-emitted after the update so it re-recorded the renamed path).
Fix
`normalize_executable_path` collapses a trailing `.(.)*.bak` update stamp after the deleted decoration, restoring the agent's real basename for both consumers. Guarded the other way: at least one digit group is required, and the surviving basename must still carry a letter, so a file genuinely named `foo.bak` and version-style launcher basenames (`1.2.3.bak`) keep their names.
Recovered live inputs are the first test cases, including the exact observed `/home/mirro/bin/omp.1795438578597.2330537.0.bak (deleted)`, and an end-to-end test runs the normalized path back through `proc_match::identify`.
Verification
`cargo test -p mux --lib`: 369 passed, 0 failed (3 new tests in `agent_status::identify`).