Skip to content

Scheduler: record an end time on finished fires #2298

Open

Description

@kantord

Problem

A finished scheduled fire carries no end time, so nothing can say how long it ran. Studio's run history therefore cannot show or sort by duration, which #1852's acceptance criteria listed. #2194 merged without a Duration column for this reason.

Evidence

  • makeFireFunc in internal/app/scheduler_fire.go builds the terminal port.ScheduleFire with FiredAt, StartedAt, Deadline, Stop and Err, but not ProgressAt. Review of feat(studio): complete schedule management workspace #2194 reports that RecordFire in all three stores replaces the in-flight record with this terminal one, so any progress instant is dropped.
  • Confirmed on a real local mecated (JSONL store, mock provider): a one-shot that fired and finished with stop: "end_turn" came back from GET /v1/schedules/<name>/fires with startedAt set and progressAt: null.
  • ScheduleFire.progress_at is documented as "the last observed progress instant" (contracts/proto/mecatl/v1/schedule.proto), not an end time.

Options

  1. Reuse progress_at. Set it to the finish time when the terminal fire is recorded. Small change, no wire change, and the Studio duration code works as written. It stretches the field's documented meaning.
  2. Add an explicit end time (for example ended_at) to the fire. This is the unambiguous contract. It touches engine/port/schedule.go, the memory, jsonl and redis stores, the shared scheduleconformance suite, scheduler_fire.go, grpc_schedule.go, the proto and its generated code, then the SDK and the Studio BFF contract.

The proto change in option 2 is additive, but it needs the wire API compatibility assessment before implementation.

Acceptance

  • A terminal fire reports an end time through the gRPC and REST fire APIs, for success, failure, cancel and timeout.
  • The conformance suite covers it for every store.
  • Studio can restore the Duration column and its sort (removed in feat(studio): complete schedule management workspace #2194) from that field.

Context

Follow-up to #2194 and #1852.

Fully or partially written by an AI agent.

Activity

  1. self-assigned this
    on Oct 14, 2026
  2. kantord commented on Oct 15, 2026

    @kantord
    MemberAuthor

    Evidence from triaging #1852's leftovers, so the fix is not designed around the prototype's formula.

    The prototype has a Duration column, so Studio wants it back. Its formula cannot be copied: fireDurationMs computes progressAt || deadline || startedAt. On a real local mecated the terminal fire has progressAt: null and a deadline that is startedAt plus the 30-minute fire timeout, so the prototype's fallback reads about 30 minutes for a run that took seconds.

    So Duration needs a real end time from the backend; the client should not infer one. The terminal record is built at scheduler_fire.go#L264-L273 without one.

    Acceptance addition: once the backend reports an end time, restore the Duration column and its sort in the run history (Studio removed it in #2194), using that field. Tracked on the Studio side by #2299.

    Fully or partially written by an AI agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions