Skip to content

feat: disable cache if exit with non-zero#102

Merged
branchseer merged 2 commits intomainfrom
01-14-feat_disable_cache_if_exit_with_non-zero
Jan 14, 2026
Merged

feat: disable cache if exit with non-zero#102
branchseer merged 2 commits intomainfrom
01-14-feat_disable_cache_if_exit_with_non-zero

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Jan 13, 2026

Enhanced Task Caching with Cache Update Status Tracking

TL;DR

Added detailed cache update status tracking to the task execution system to provide better visibility into caching operations.

What changed?

  • Added new enums to track cache update status:
    • CacheUpdateStatus: Tracks whether the cache was updated or not
    • CacheNotUpdatedReason: Provides specific reasons why a cache wasn't updated (cache hit, disabled caching, non-zero exit status)
  • Modified the ExecutionEventKind::Finish event to include the new cache_update_status field
  • Updated execution logic to properly set cache update status in different scenarios:
    • When replaying from cache
    • When caching is disabled
    • When execution fails with non-zero status
    • When cache is successfully updated

How to test?

Run tasks with different caching scenarios and verify the correct cache update status is reported:

  1. Run a cached task to see CacheHit status
  2. Run a task with caching disabled to see CacheDisabled status
  3. Run a failing task to see NonZeroExitStatus status
  4. Run a successful task with caching enabled to see Updated status

Why make this change?

This change provides more detailed information about cache operations, making it easier to understand why a task's cache was or wasn't updated. This visibility helps with debugging cache-related issues and provides better insights into the task execution system's behavior.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer changed the title feat(session): add CacheUpdateStatus to ExecutionEventKind::Finish feat: add cache update status tracking to execution events Jan 13, 2026
@branchseer branchseer changed the title feat: add cache update status tracking to execution events feat: disable cache if exit with non-zero Jan 13, 2026
@branchseer branchseer marked this pull request as ready for review January 13, 2026 17:21
branchseer and others added 2 commits January 14, 2026 11:56
Add CacheUpdateStatus enum to track whether cache was updated after task
execution and why. This provides visibility into cache behavior in the
Finish event.

- Add CacheNotUpdatedReason enum with CacheHit, CacheDisabled, NonZeroExitStatus
- Add CacheUpdateStatus enum with Updated and NotUpdated variants
- Include cache_update_status in ExecutionEventKind::Finish
- Update all Finish event emissions to include appropriate status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@branchseer branchseer force-pushed the 01-14-feat_disable_cache_if_exit_with_non-zero branch from d50092b to 2041b38 Compare January 14, 2026 04:01
@branchseer branchseer merged commit 493e67b into main Jan 14, 2026
7 checks passed
@branchseer branchseer deleted the 01-14-feat_disable_cache_if_exit_with_non-zero branch January 14, 2026 14:38
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.

2 participants