Repository navigation
Conversation
226eb58 to
d75c553
Compare
|
Thanks Jeff! Before getting into the design: we're in the bug-bash freeze for v0.4, and task timelines / cost attribution aren't on the v0.4 or v1.0 list yet. Since this wraps the task write path, could we park it until after v1.0 and talk through where it fits then? Happy to look sooner if there's a user waiting on it |
|
Thanks Maya, happy to respect the v0.4 freeze. One framing note: this isn't only for cost. It's the task-level counterpart of Substrate's ate.actor.state_changed / ate.actor.crashed. Today AX keeps no history of why a task went Failed, when a delete moved it to Terminating, or when its actor was recreated with a new UID; ax describe only shows the current state. The events carry ate.actor.uid, so operators can line up task and actor timelines and tell an AX problem from a Substrate one. What do you think would be the best version to have this PR? No user is blocked on it, so I'll keep it rebased and we can talk through where it fits after v1.0. |
|
That's a good point, task history for debugging is a real gap, and lining up with the ate.actor.* events makes sense. Could you open an issue with that framing? Let's look at where it fits once the rc is out |
|
Heads-up: #719 dropped |
d75c553 to
bda9fa6
Compare
bda9fa6 to
22cb5e1
Compare
|
@mayawang updated |
a5460fc to
e93aa79
Compare
Cost attribution and task timelines need a record of each change of task phase that joins with the actor events of Agent Substrate. The task write helpers return a taskWrite with the phase before and after the write and the time of the write. Each handler passes the phase that it read under the per-task lock, so a write needs no extra read. The caller emits the taskWrite through the new telemetry.EmitAt. CreateTask and clearStoredTaskState emit after applyActor, so a Provisioned record gets ate.actor.uid with no extra Substrate call. The phases are Provisioned, Queued (after a transient ResumeTask error), Terminating, and Deleted. A failed write, or a write that keeps the phase, emits nothing. substratetest gets a GetActor error and a GetActor hook for the tests.
e93aa79 to
031c8c0
Compare
Emit
ax.task.state_changedafter each task write that changes the task's phase, so task timelines and cost attribution can join AX tasks with Agent Substrate'sate.actor.*events.Part of #675. Main has no task outcome or exit code now (#707, #756), so the event does not carry them. Related to #13 and #471.
taskWrite(phase before and after, write time). Each handler passes the phase that it read under the per-task lock, so a write needs no extra read.telemetry.EmitAt.CreateTaskandclearStoredTaskStateemit afterapplyActor, soProvisionedgetsate.actor.uidwith no extra Substrate call.ax.task.name,ate.atespace,ax.task.id,ax.task.phase,ax.task.previous_phase, andate.actor.uid(Provisionedonly).Provisioned(the first phase, because server: store a task only once its actor exists #761 stores a task only after its actor exists),Queued(after a transientResumeTaskerror),Terminating,Deleted.docs/observability.mdexplains each one.substratetestgets aGetActorerror and aGetActorhook for the tests.Validation
make verify,go build,go test ./...(27 packages), andgo test -raceforinternal/server,internal/substrate, andinternal/telemetry. The tests cover each phase change, failed creates, failed store writes, an unreadable actor, and the write-time timestamp.Written with help from an AI coding assistant.