You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Ready condition's update time changes on every read, even when nothing changed #539
Every time you read a task, its Ready condition comes back with a new updateTime, even though the task and its actor haven't changed. So the timestamp no longer tells you when the task last changed, which is what clients use it for. Anything that polls ax and looks for changes, like a dashboard or a sync loop, sees every task as changed on every poll.
This started with #515, when Ready became derived from the actor's state on each read. The comment on setReady says the update time changes only when the condition does, but that's only true within a single call.
Example
A test against upstream main (f0228f1) creates a task, then calls GetTask twice, a second apart:
s1, t1:=ready() // GetTask, then return the phase, Ready status, reason and updateTimetime.Sleep(1100*time.Millisecond)
s2, t2:=ready()
first GetTask: Suspended False Suspended updateTime=2026-10-31T18:40:08.767301281Z
second GetTask: Suspended False Suspended updateTime=2026-10-31T18:40:09.868168323Z
--- FAIL: Ready did not change, but its updateTime did
The cause is in internal/server/server.go. storedStatus drops the Ready condition before saving, for any phase that comes from Substrate. On the next read there's no Ready condition to compare against, so setReady appends a new one with UpdateTime: timestamppb.Now().
We hit this in substrate-scope, a visualizer that polls ax. It had to start ignoring Ready's updateTime altogether to stop treating every task as changed on every poll.
Proposed solution
Give the derived Ready condition a timestamp that only moves when its inputs do. Substrate already has one: the actor's metadata.update_time, which changes on every mutation of the actor. When Ready is built from the actor's state, use that time (or the later of it and the WorkspaceReady condition's time, since a running task's Ready also depends on workspace setup) instead of timestamppb.Now(). Repeated reads of an unchanged task then return the same value, and a real change still moves it.
Another option is to store the last derived Ready condition and keep its time when the new one matches. That works too, but it puts a write on the read path, and the actor's own timestamp already answers the question.
Confirmed still present on current main (@ af62e9d) — the anchors have moved since this was filed, so here is the updated map:
StoredStatus (internal/store/task_apply.go:137-158, the runner seam from store: add TaskRow, TaskApplier, and StoredStatus runner seam #591) still drops the Ready condition for every state outside IsAXTaskState (pkg/apis/v1alpha1/types.go:136-145), so live-derived phases like WORKING/SUSPENDED never persist Ready.
On every read (getTask → applyActor → setActorStatus, internal/server/server.go:529/605/618) the condition is recomputed, and the stored status has no Ready to compare against, so setReady (:721-741) falls through to the append branch stamped timestamppb.Now(). A read writes nothing back, so every GetTask/ListTasks returns a fresh updateTime on an unchanged task — exactly the false change your substrate-scope poller had to filter out.
@mastersingh24 you filed this and posted fix-ready-update-time @ 06454ee with "PR to follow" 19 days ago, and no PR has appeared since. Are you still planning to submit it? If the collaborators_only policy (#358) is what's blocking, a maintainer can open the PR from your fork (that's the route MushuEE offered on #489), and if the branch just needs attention, happy to help however is useful.
Two observations from an independent walkthrough, offered as input for your fix rather than a competing patch — it's your issue and your approach, so I'm not attaching one:
The residual-churn windows are the error and terminating branches.SubstrateUnavailable (:636), ActorNotFound (:647), and the terminating branches (:631/:640/:656) have no actor timestamp to source, so a task parked in any of those states keeps minting a fresh updateTime per read — the same false-change signal, just confined to error/deletion windows. Anything sourcing those stamps from data that survives the StoredStatus strip avoids it; sourcing from the actor can't work there by construction (there is no actor), which is presumably why the wall-clock fallback exists. Worth deciding explicitly whether documented churn in those states is acceptable, or whether the last value should be carried in a stored field.
One guard worth adding either way: a test that pins the real control plane's metadata.update_time population on GetActor responses — your fake change mirrors it, but if Substrate ever stops setting it, every stamp degrades to zero-time/Now silently.
Happy to test the branch against current main when it lands.
Activity
mastersingh24 commentedon Oct 31, 2026
Fix is on https://github.com/mastersingh24/ax/tree/fix-ready-update-time (commit 06454ee). Ready now takes the actor's
metadata.update_time, or WorkspaceReady's time for a running task when that is later. TheSubstrateUnavailableandActorNotFoundcases have no actor timestamp and still use the current time. PR to follow.feat(atelocal): populate Actor Metadata.CreateTime and UpdateTime (go…
chore: ax-server 04de913 (substrate-v1-r2) (#48) (#70)
feat(atelocal): populate Actor Metadata.CreateTime and UpdateTime (go…
feat(atelocal): populate Actor Metadata.CreateTime and UpdateTime (go…
feat(atelocal): populate Actor Metadata.CreateTime and UpdateTime (go…
yjjnls commentedon Nov 19, 2026
Confirmed still present on current main (@ af62e9d) — the anchors have moved since this was filed, so here is the updated map:
StoredStatus(internal/store/task_apply.go:137-158, the runner seam from store: add TaskRow, TaskApplier, and StoredStatus runner seam #591) still drops theReadycondition for every state outsideIsAXTaskState(pkg/apis/v1alpha1/types.go:136-145), so live-derived phases like WORKING/SUSPENDED never persist Ready.getTask→applyActor→setActorStatus, internal/server/server.go:529/605/618) the condition is recomputed, and the stored status has no Ready to compare against, sosetReady(:721-741) falls through to the append branch stampedtimestamppb.Now(). A read writes nothing back, so everyGetTask/ListTasksreturns a freshupdateTimeon an unchanged task — exactly the false change your substrate-scope poller had to filter out.@mastersingh24 you filed this and posted
fix-ready-update-time@ 06454ee with "PR to follow" 19 days ago, and no PR has appeared since. Are you still planning to submit it? If thecollaborators_onlypolicy (#358) is what's blocking, a maintainer can open the PR from your fork (that's the route MushuEE offered on #489), and if the branch just needs attention, happy to help however is useful.Two observations from an independent walkthrough, offered as input for your fix rather than a competing patch — it's your issue and your approach, so I'm not attaching one:
The stable-source idea still fits the seams that have landed since 10-31. The store/schema refactors (task: update v1alpha1 Task and ObjectMeta schema and update codebase #587, api: clean up v1alpha1 proto field numbers and Task status types #605, store: add TaskRow, TaskApplier, and StoredStatus runner seam #591) kept both touchpoints your branch needs: the actor object is at hand in
setActorStatus(soactor.metadata.update_timeis available), andWorkspaceReadyis one of the conditions that survives storage — onlyReadyis stripped — so "the later of actor update time and WorkspaceReady time" composes cleanly with the running-task branch at server.go:666-671. Expect a rebase (your base is f0228f1), but no redesign.The residual-churn windows are the error and terminating branches.
SubstrateUnavailable(:636),ActorNotFound(:647), and the terminating branches (:631/:640/:656) have no actor timestamp to source, so a task parked in any of those states keeps minting a freshupdateTimeper read — the same false-change signal, just confined to error/deletion windows. Anything sourcing those stamps from data that survives theStoredStatusstrip avoids it; sourcing from the actor can't work there by construction (there is no actor), which is presumably why the wall-clock fallback exists. Worth deciding explicitly whether documented churn in those states is acceptable, or whether the last value should be carried in a stored field.One guard worth adding either way: a test that pins the real control plane's
metadata.update_timepopulation onGetActorresponses — your fake change mirrors it, but if Substrate ever stops setting it, every stamp degrades to zero-time/Now silently.Happy to test the branch against current main when it lands.