Skip to content

fix(headless): force Harbor deadline settlement and atomically persist final cell artifacts #1078

Closed

Description

@Astro-Han

Problem

Headless Harbor cells currently request benchmark deadline settlement with stopSession(..., mode: "after_step"). An active provider stream or tool step can outlive the settlement window, allowing Harbor's hard timeout to kill the host before maka-cell-output.json and trusted runtime usage are persisted.

Evidence collected in #1021:

  • v1: 9 checkpoint-only cells across 8 pairs;
  • v2: 5 checkpoint-only cells across 4 complete pairs despite a 120-second settlement grace;
  • affected cells hit their native 900/1800/3600-second agent timeout and lacked final cell output.

Checkpoint usage must remain excluded from official economy totals because it can omit the final provider or compact call.

Scope

Implement a bounded cell deadline contract:

  1. at the soft deadline, immediately stop the active provider/tool step;
  2. aggregate the durable runtime events that exist after cancellation;
  3. atomically publish runtime events followed by final cell output before the Harbor hard timeout;
  4. retain Harbor hard kill as the final process fallback.

after_step is not a model-visible request to wrap up, and an unbounded active step cannot provide a reliable settlement guarantee. The final tokenSummary is the aggregate derived from durable runtime events after forced settlement; it is never backfilled from checkpoint usage and may not include usage that the provider did not report for the cancelled call.

This issue owns cell termination and final-artifact durability. Run scheduling and report completeness belong to the sibling issue linked from #1021.

Acceptance criteria

  • A synthetic backend or tool step that outlives the soft deadline is force-stopped before the host hard deadline.
  • The cell atomically publishes runtime-events.jsonl and then maka-cell-output.json, with deadline provenance and the final runtime-derived token summary when available.
  • The attempt remains a single Pass@1 sample and is represented as budget-exhausted rather than an infrastructure exclusion.
  • No continuation turn starts after the deadline latch.
  • Normal completion racing with the deadline produces exactly one terminal outcome.
  • Checkpoint-only usage is not promoted to final usage.
  • A Harbor-level regression test covers the real host deadline path.

Out of scope

Parent: #1021.

Activity

  1. added
    bug
    on Jul 16, 2026
  2. changed the title [-]fix(headless): stage Harbor deadline settlement and persist final cell artifacts[/-] [+]fix(headless): force Harbor deadline settlement and atomically persist final cell artifacts[/+] on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions