Skip to content

feat(parser): capture background_tasks and session_crons from v2.1.145+ Stop/SubagentStop hooks#108

Merged
delexw merged 1 commit into
mainfrom
fix-issue-106
May 26, 2026
Merged

feat(parser): capture background_tasks and session_crons from v2.1.145+ Stop/SubagentStop hooks#108
delexw merged 1 commit into
mainfrom
fix-issue-106

Conversation

@delexw
Copy link
Copy Markdown
Owner

@delexw delexw commented May 23, 2026

Summary

Adds background_tasks and session_crons as optional fields on the Entry struct to handle the new Stop/SubagentStop hook payload fields introduced in Claude Code v2.1.145.

Problem

Claude Code v2.1.145 (May 19, 2026) added two new fields to Stop and SubagentStop hook input payloads:

  • background_tasks — array of currently-running background task descriptors
  • session_crons — array of cron jobs registered for the session

Without explicit struct fields, serde silently skips these arrays on deserialization. While this does not cause parser crashes (no deny_unknown_fields is in use), the data is lost and future code cannot access it. Declaring the fields explicitly captures the payloads and makes the compat intent clear.

Changes

  • src-tauri/src/parser/entry.rs: Added background_tasks: Option<Value> and session_crons: Option<Value> to Entry, both with #[serde(default)] so pre-v2.1.145 entries (where the fields are absent) default to None without error. Added 3 tests covering: Stop hook with both fields populated, pre-v2.1.145 Stop hook with neither field present, and SubagentStop hook with an empty background_tasks array and a multi-item session_crons array.
  • specs/01-parser-pipeline.md: Added the two new fields to the Key Fields table.

Testing

All 400 Rust tests pass (cargo test). All 349 frontend tests pass (vitest run). cargo clippy -- -D warnings reports no issues.

Fixes #106

…145+ compat

Stop and SubagentStop hook input payloads in Claude Code v2.1.145+ include two
new fields: background_tasks (array of running task descriptors) and session_crons
(array of session-scoped cron jobs). Add both as Option<Value> to Entry so they
are captured rather than silently skipped on future hook entries.

Fixes #106
@delexw delexw merged commit da22c00 into main May 26, 2026
1 check passed
@delexw delexw deleted the fix-issue-106 branch May 26, 2026 06:50
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.

[Compat] Claude Code v2.1.145: Stop/SubagentStop hook entries gain background_tasks and session_crons fields

1 participant