Skip to content

feat: v0.20.0 — replay annotations (notes, labels, bookmarks)#36

Merged
Siddhant-K-code merged 2 commits into
mainfrom
feat/v0.20.0-replay-annotations
Apr 11, 2026
Merged

feat: v0.20.0 — replay annotations (notes, labels, bookmarks)#36
Siddhant-K-code merged 2 commits into
mainfrom
feat/v0.20.0-replay-annotations

Conversation

@Siddhant-K-code
Copy link
Copy Markdown
Owner

Closes #26

What

Adds annotate.py — a sidecar annotation system that attaches notes, labels, and bookmarks to trace events without modifying events.ndjson.

Storage

Annotations are stored in .agent-traces/<session-id>/annotations.jsonl. Each annotation has:

  • annotation_id — 12-char hex ID
  • event_id — links to a specific event
  • offset_seconds — alternative: time offset from session start
  • label — one of root-cause, decision, retry, fix, question (or custom)
  • note — free-text
  • author — optional

Time offset parsing

--at 2m14s, --at 1:30, --at 45s — finds the nearest event to the given offset.

CLI

agent-strace annotate <session> --event ev-00042 --note "root cause here" --label root-cause
agent-strace annotate <session> --at 2m14s --note "retry loop starts"
agent-strace annotate <session> --list
agent-strace annotate <session> --delete <annotation-id>

share integration

agent-strace share renders a bookmarks sidebar when annotations exist (see PR #34).

Tests

tests/test_annotate.py — 14 tests.

Ona and others added 2 commits April 11, 2026 16:31
Adds annotate.py with a sidecar annotations.jsonl file per session.
Annotations carry a label (root-cause, decision, retry, fix, question),
a free-text note, an event_id or time offset, and an optional author.
share.py renders a bookmarks sidebar linking to annotated events.

CLI: agent-strace annotate <session> --event <id> --note <text> --label <label>
     agent-strace annotate <session> --at 2m14s --note <text>
     agent-strace annotate <session> --list
     agent-strace annotate <session> --delete <annotation-id>

Closes #26

Co-authored-by: Ona <no-reply@ona.com>
- Replace __dataclass_fields__ with dataclasses.fields() for Python
  compatibility across 3.10–3.13
- Use store.annotations_path() instead of store._session_dir() to
  avoid depending on a private method

Co-authored-by: Ona <no-reply@ona.com>
@Siddhant-K-code Siddhant-K-code merged commit be73e05 into main Apr 11, 2026
4 checks passed
@Siddhant-K-code Siddhant-K-code deleted the feat/v0.20.0-replay-annotations branch April 11, 2026 17:37
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.

v0.20.0: Replay annotations - attach notes, labels, and bookmarks to trace events

1 participant