Skip to content

Studio: the server tests' recorded log ages out of the prune 30 days after its last line #792

Done

Description

@danielrispler

Parent

None. Found while opening #791 (#779).

What to build

Three server tests have failed on every branch since 2026-11-28 ~10:03 IST:

  • read_loop::the_replay_sends_the_list_once_and_a_live_line_sends_it_again
  • web::a_command_answers_as_the_function_behind_it_does
  • web::another_command_answers_while_a_subagents_log_is_read

Cause, verified:

  • Follower::start prunes the event log by the real clock before it replays it: studio_hook::prune(log, millis()) at server/src/read_loop.rs:213 (3d44062).
  • The prune archives every session whose last event is more than KEEP = 30 days old (hook/src/lib.rs:168).
  • Those tests replay core/tests/fixtures/two-sessions.jsonl. Its last line is studio_received_ms 1793261013520, which is 2026-10-29 10:03 IST.
  • Since 30 days after that, its sessions are archived before the replay, and the list the tests expect is empty: web.rs:219 asserts it isn't empty.
  • main's last green studio.yml run started at 2026-11-28T02:29Z, before the cutoff (gh run list --branch main --workflow studio.yml).

The fix: those tests give the prune a fixed clock. Follower::start_at(app, log, now_ms) takes it, and Follower::start passes the real one, so the app is unchanged. The tests pass a day after the fixture's last line. Shifting the fixture's timestamps instead would only reset the 30-day count, and the tests also append lines with fixed timestamps of their own.

Acceptance criteria

  • The three tests pass whatever today's date is.
  • Follower::start behaves as before for the app.
  • npm run check passes.

Reading

None — no prior decisions or research required. The prune is from #132.

Touches

  • Files: server/src/read_loop.rs, server/tests/read_loop.rs, server/tests/web.rs
  • Session: auto mode
  • Route: cheap · effort medium — a test clock for one prune call in three test files, no stored type

Activity

  1. added
    bug
    ready-for-agent
    on Nov 28, 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

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions