Skip to main content

context_history

Function context_history 

Source
pub fn context_history(run_id: &str) -> Vec<RunPoint>
Expand description

A run’s context-window history: the full window (+ metadata) at each recorded point over time, oldest first. Empty when there’s no readable archive.

Every point’s meta is RunMeta::redacted. The journal stores RunMeta whole - including callback_secret, which the daemon needs to keep signing webhooks for a run it reloads - so a replayed point carries the secret unless it is stripped here. GET /api/agents/{id}/context/history serialized these points directly, which handed the webhook signing key to any holder of the API token: the same disclosure redacted() was introduced for on /api/agents, re-opened through the archive.

Redacted in this shared reader rather than in that one handler so the next consumer of a run’s history inherits the fix instead of having to remember it. No caller needs the secret: the CLI printer, the dashboard, and the API all only display these points.