Skip to content

Bound Agent Workflow tracking so that local state is automatically pruned - #1935

Draft
ericclemmons wants to merge 3 commits into
codex/workflow-retention-trackingfrom
codex/workflow-tracking-retention
Draft

Bound Agent Workflow tracking so that local state is automatically pruned#1935
ericclemmons wants to merge 3 commits into
codex/workflow-retention-trackingfrom
codex/workflow-tracking-retention

Conversation

@ericclemmons

@ericclemmons ericclemmons commented Jul 13, 2026

Copy link
Copy Markdown
Member

tl;dr – Automatically prune terminal Agent Workflow tracking rows from local SQLite.

Agent Workflow tracking currently grows without bound even after the Workflow platform expires instance state. This persists normalized success/error retention, derives an indexed expires_at after the terminal outcome is known, and maintains one earliest-expiry cleanup alarm per Agent or facet owner.

Cleanup is armed when runWorkflow() first writes tracking state, reconciles missed terminal callbacks after eviction or crashes, deletes expired local rows, and stops when no cleanup remains. Omitted retention uses a bounded 30-day local fallback because the SDK cannot detect Workers Free versus Paid; this improves the existing unbounded behavior.

This deletes only Agent-local SQLite tracking. It never deletes Workflow platform instances, state, or logs.


References: retention passthrough PR, Agents cleanup strategy

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 430722e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Patch
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1935

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1935

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1935

create-think

npm i https://pkg.pr.new/create-think@1935

hono-agents

npm i https://pkg.pr.new/hono-agents@1935

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1935

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1935

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1935

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1935

commit: cd9cf26

@ericclemmons ericclemmons self-assigned this Jul 13, 2026
@ericclemmons

Copy link
Copy Markdown
Member Author

/bonk review

@ask-bonk

ask-bonk Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@ericclemmons Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@ericclemmons
ericclemmons force-pushed the codex/workflow-tracking-retention branch from 430722e to cd9cf26 Compare July 27, 2026 22:46
@ericclemmons
ericclemmons changed the base branch from main to codex/workflow-retention-tracking July 27, 2026 22:46
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