Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

think: allow a per-instance submissionRecoveryStaleMs (900 s default equals the alarm wall)

Open Beginner friendly
#2,498 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
ai, backend, cloud

Research direction

Start from the stale-window read at dist/think.js:7156 (this.constructor.submissionRecoveryStaleMs) and _recoverSubmissionsOnStart around :7099-7114. Prefer an instance submissionRecoveryStaleMs (or a protected getter) over the static default of 900000 ms, then expose it in the typings. Done when mixed agent instances in one Durable Object class can use different cutoffs without a class-wide override.

Written by the indexing model from the issue text.

Description

Summary

@cloudflare/think 0.20.0 reads its stale-submission window only from the class: this.constructor.submissionRecoveryStaleMs (dist/think.js:7156, declared protected static, default 900 * 1e3 at :11276). One Durable Object class cannot use different windows for different kinds of agent instances.

Why it matters

The default (900 s) equals the Durable Object alarm wall limit (15 min). A submission whose turn starts with its alarm and runs until the wall cut is always older than 900 s at the next wake. _recoverSubmissionsOnStart (think.js:7099-7114) then marks it error ("Submission was interrupted after messages were applied.") before chat recovery runs, although chat recovery goes on to continue the same turn. Code that reacts to the submission status sees a terminal error for a turn that later completes.

We hit this with long-running background agents (helpers that read documents for 10+ minutes). For interactive chat agents, the 900 s default is right, so a class-wide override is wrong for us: both kinds share one class.

Request

Let an instance choose the window, for example by reading an instance value first:

const cutoff = Date.now() - (this.submissionRecoveryStaleMs ?? this.constructor.submissionRecoveryStaleMs);

with a protected get submissionRecoveryStaleMs(): number | undefined in the typings, or an equivalent protected hook. We carry this one-line change as a pnpm patch until a release exposes it.

Environment

@cloudflare/think 0.20.0, agents 0.25.0, Workers with EU jurisdiction Durable Objects.

Dominant language
TypeScript
Stars
5.8k
Forks
775
Avg merge
20h 44m
Merged PRs (30d)
165

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/agents

All issues in cloudflare/agents

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.