Skip to content

Stop active TinyFish requests when dataset runs are cancelled#151

Draft
dunkeln wants to merge 1 commit into
tinyfish-io:mainfrom
dunkeln:codex/cancel-tinyfish-on-stop
Draft

Stop active TinyFish requests when dataset runs are cancelled#151
dunkeln wants to merge 1 commit into
tinyfish-io:mainfrom
dunkeln:codex/cancel-tinyfish-on-stop

Conversation

@dunkeln

@dunkeln dunkeln commented Jul 23, 2026

Copy link
Copy Markdown

What changed

  • Build search and fetch tools per dataset run instead of sharing module-level tool instances.
  • Combine each dataset workflow signal with the existing 30-second TinyFish timeout.
  • Propagate user-initiated cancellation as AbortError while preserving recoverable timeout errors.
  • Wire the scoped tools through populate, investigate, and refresh agents.

Why

The stop routes abort the dataset controller and agent generation, but TinyFish requests previously used independent timeout controllers. An in-flight search or fetch could therefore continue after the user stopped the run, consuming time and potentially provider credits.

Impact

Stopping a building or refreshing dataset now also terminates its active TinyFish HTTP request. Concurrent datasets remain isolated because each tool closure captures its authorized dataset ID.

Verification

  • TypeScript compilation with backend/node_modules/.bin/tsc
  • Runtime cancellation probe confirmed Stop propagates AbortError
  • Runtime timeout probe confirmed provider timeout remains a normal tool error
  • Diff whitespace validation passed

Not changed

This does not alter workflow status transitions, retry behavior, TinyFish response contracts, or model configuration.

Stopping a dataset aborted agent generation but left active TinyFish HTTP calls running until their timeout, wasting time and potentially consuming provider credits.

Scope web tools to their authorized dataset and combine the workflow signal with the existing request timeout. User stops now propagate AbortError while provider timeouts remain recoverable tool errors.

This does not change workflow status handling, retry behavior, or TinyFish response contracts.

Co-authored-by: Codex <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 88f63676-d7ca-4f8a-9bab-6c8164c46ef2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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