Skip to content

herald: announce finished turns again on Paseo 0.14 (turn_ended timeline is empty) - #109

Open
g0rdonL wants to merge 2 commits into
gpambrozio:mainfrom
g0rdonL:fix/herald-empty-turn-timeline
Open

g0rdonL wants to merge 2 commits into
gpambrozio:mainfrom
g0rdonL:fix/herald-empty-turn-timeline

Conversation

@g0rdonL

@g0rdonL g0rdonL commented Nov 1, 2026

Copy link
Copy Markdown

Problem

Paseo 0.14 always sends agent.turn_ended with timeline: []. The daemon hard-codes it in plugins/lifecycle/index.js (publishAgentStream), and @getpaseo/plugin now marks the field:

@deprecated Always empty. Fetch history on demand with context.paseo.agents.ref(agent.id).timeline.refetch({ direction: "tail", limit: 20 }).

Herald's turn_ended handler takes the reply from event.timeline. An empty timeline gives output === "", so every completed turn is treated as wordless and dropped. Only failed or canceled turns and permission requests still get through.

On a 0.14 daemon running Herald 0.6.1, that came to 3 summaries for about 60 finished turns in an afternoon, and 0 for 52 over the night before.

Fix

  • When the event's timeline is empty, turn_ended reads the tail of the agent's projected timeline: fetchRecentTimeline, 50 items, so the user's message is still in reach after a run of tool calls. Hosts that still send a timeline are used as they are and never fetched.
  • The fetch is an await before record, so the handler checks the agent's generation again after it. A turn the agent moved on from during the fetch is dropped, the same way as the existing config and workspace-title awaits.
  • If the fetch fails, the handler logs it and uses an empty history. The behaviour then matches what the event itself said.
  • fetchTimeline is injectable through HookDeps. The test setup() defaults it to [], so existing tests are unchanged.
  • AGENTS.md gets a section under "turn_ended can repeat", and the CHANGELOG gets an [Unreleased] entry.

Tests

  • 6 new tests: fetch on an empty timeline, no fetch when the event has one, a fetched history with no reply still drops, moving on during the fetch drops, and fetchRecentTimeline's request shape and failure path.
  • Without the fix, the two tests covering the new behaviour fail.
  • vitest run: 131 passed. tsc --noEmit: clean.
  • I patched the change into a live 0.6.1 install on a 0.14 daemon. A live end-to-end announcement is still pending a plugin reload on that machine.

🤖 Generated with Claude Code

g0rdonL and others added 2 commits November 1, 2026 17:54
Paseo 0.14 always sends agent.turn_ended with timeline: [] (deprecated in
the SDK; fetch via agents.ref(id).timeline.refetch). Herald read that as
a wordless turn and dropped every completed turn, so almost nothing was
announced after the 0.14 upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant