Skip to content

feat(event-log): tag task_id / workflow_id from Loom env#51

Merged
Shahinyanm merged 1 commit into
masterfrom
feat/loom-spine-task-id
Jun 14, 2026
Merged

feat(event-log): tag task_id / workflow_id from Loom env#51
Shahinyanm merged 1 commit into
masterfrom
feat/loom-spine-task-id

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

When a session is launched by the Loom host, hook events get tagged with the Loom task so token savings can be attributed to a task exactly (the shared-ID "spine").

  • HookEvent gains optional task_id.
  • appendEvent auto-tags task_id from LOOM_TASK_ID and extends the workflow_id source chain with LOOM_WORKFLOW_ID (alongside existing TOKEN_PILOT_WORKFLOW_ID / CLAUDE_CODE_WORKFLOW_ID).

Backward compatibility

Env-driven and additive. Outside Loom (no env) the emitted event is byte-identical to before — covered by a test asserting task_id is absent when LOOM_TASK_ID is unset.

Verification

  • npx vitest run1402 pass (added 3 tests). The only 3 failures are pre-existing, environment-only (context-mode-detector finds a real ~/.mcp.json) and unrelated — confirmed by stashing this change and re-running.
  • npx tsc --noEmit → clean

🤖 Generated with Claude Code

Additive, backward-compatible: when a session is launched by the Loom
host (LOOM_TASK_ID / LOOM_WORKFLOW_ID set), hook events get tagged so
token savings can be attributed to a Loom task exactly.

- HookEvent gains optional task_id.
- appendEvent auto-tags task_id from LOOM_TASK_ID and extends the
  workflow_id source chain with LOOM_WORKFLOW_ID (alongside the existing
  TOKEN_PILOT_WORKFLOW_ID / CLAUDE_CODE_WORKFLOW_ID).

Outside Loom (no env) events are byte-identical to before. 1402 tests
pass (3 pre-existing env-only failures in context-mode-detector are
unrelated — confirmed by stashing this change); tsc clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Shahinyanm Shahinyanm merged commit fba0fea into master Jun 14, 2026
2 checks passed
@Shahinyanm Shahinyanm deleted the feat/loom-spine-task-id branch June 14, 2026 07:01
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