Repository navigation
fix: a status set without a time doesn't keep the old one (MUS-113) - #197
Merged
Merged
Conversation
SetSessionCurrentTask is hand-written in place of the #[myko_setter], under
the same name and wire shape ({id, currentTask}), and stamps current_task_at
with the daemon's clock as it sets the status, or clears it with the status.
A TypeScript plugin sets the status with that command alone, so before this
the time an earlier status left stayed beside the new one and a fresh status
read as hours old. The shim still follows with SetSessionCurrentTaskAt for an
older daemon.
Story: MUS-113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
MUS-113, the follow-up the watchman found while reading MUS-101. This is stacked on #184. Its base is
feat/roster-status-age, so the diff shows only this change. Merge it after #184 and retarget it tomain.The gap: the TypeScript plugins set the status with
SetSessionCurrentTaskalone. That left thecurrent_task_atfrom an earlier status sitting beside the new one, so a fresh status could read as hours old.The fix:
SetSessionCurrentTaskis now written by hand incrates/entities/src/session.rsinstead of being generated by#[myko_setter]. It keeps the same command name and the same wire shape ({id, currentTask}), so no client changes.current_task_atwith the daemon's clock.current_task_attoo.So every client, the plugins included, gets a true age from that one command. The shim still sends
SetSessionCurrentTaskAtafterwards, because an older daemon needs it. On a new daemon that second command only replaces the stamp with the shim's own clock's.Why stamp rather than only clear: clearing would rely on the shim's two commands being applied in order. If they ran the other way round, the age would vanish. Stamping gives the right answer in either order. It also covers three of the follow-ups listed under MUS-101: the daemon stamps the time, the plugins get ages, and the status and its time are set in one command.
Tests:
crates/daemon/tests/status_time.rssends the plugins' JSON shape over a stale time. It checks that the time is replaced with now, that clearing the status leaves no time and keeps the rest of the row, and that an unknown session is refused. With the old generated setter, the stale time stays and the first test fails.Local results: fmt,
clippy --workspace --all-targets -D warningsandcargo test --workspaceare clean. I didn't run the plugin TS tests, because there's no bun here.🤖 Generated with Claude Code