Skip to content

fix(tasks): retain results after tool removal - #5507

Merged
zzstoatzz merged 2 commits into
PrefectHQ:mainfrom
mikamikasuki:fix/fmc-0010-task-result-after-removal
Nov 10, 2026
Merged

zzstoatzz merged 2 commits into
PrefectHQ:mainfrom
mikamikasuki:fix/fmc-0010-task-result-after-removal

Conversation

@mikamikasuki

@mikamikasuki mikamikasuki commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

A completed task can become unavailable when its originating tool is removed, even though the task is still within its advertised TTL. Subsequent tasks/get requests fail instead of returning the stored result.

Keep completed task results retrievable until the task expires.

Closes #5506

Contribution type

  • Bug fix (simple, well-scoped fix for a clearly broken behavior)
  • Documentation improvement
  • Enhancement

Checklist

  • This PR addresses an existing issue (or fixes a self-evident bug)
  • I have read CONTRIBUTING.md
  • I have added tests that cover my changes
  • I have run uv run prek run --all-files and all checks pass
  • I have self-reviewed my changes
  • If I used an LLM, it followed the repo's contributing conventions (not generic output)

@github-actions

This comment has been minimized.

@github-actions github-actions Bot closed this Oct 6, 2026
@github-actions github-actions Bot reopened this Oct 6, 2026
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. tasks Related to background tasks, Docket, SEP-1686. labels Oct 6, 2026
@mikamikasuki
mikamikasuki force-pushed the fix/fmc-0010-task-result-after-removal branch from ccdbf9f to f76931f Compare October 21, 2026 07:52
@andreivince

Copy link
Copy Markdown
Contributor

With mask_error_details=True, a task tool whose return value fails to serialize now shows the client the exception text. I returned a Pydantic model whose field serializer raises ValueError("synthetic serialization failure"), and that message came back in the task's error and status message. Main returns only Internal server error. Same result on f76931fa and with current main (1f9d32ee) merged in. The new result conversion looks like it runs outside the masking, so it needs the same handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzstoatzz
zzstoatzz merged commit 711575a into PrefectHQ:main Nov 10, 2026
24 checks passed
zzstoatzz added a commit that referenced this pull request Nov 10, 2026
* Revert "fix: preserve referenced schema definitions (#5588)"

This reverts commit 5f1d152.

* Revert "fix(server): rebuild tool argument errors instead of echoing pydantic's (#6107)"

This reverts commit 8fba5f7.

* Revert "Advertise the MCP Apps extension only when the server serves an app (#5062)"

This reverts commit b89222b.

* Revert "fix(tasks): retain results after tool removal (#5507)"

This reverts commit 711575a.

* Revert "fix(client): Prevent stale ClientGroup refreshes from replacing newer routes (#5543)"

This reverts commit 365d5d2.

* Revert "fix(prompts): honor field aliases when rendering prompts (#5836)"

This reverts commit a450fd8.

* Revert "Stop FastMCP callable caches from retaining dropped tools (#6147)"

This reverts commit 713f247.

* Revert "feat(auth): Add KeystoneTokenVerifier (#6264)"

This reverts commit c33f3de.

* Revert "fix(json-schema): keep x-unsupported-pattern when a format is set (#5731)"

This reverts commit dc9849d.

* Revert "Roll back the tool stamp when a tool registration is rejected (#5798)"

This reverts commit d6566c5.

* Revert "fix(server): validate cursors when pagination is disabled (#6045)"

This reverts commit 4917bee.

* Revert "Keep constraints on scalar schema references (#6041)"

This reverts commit e5176c9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. tasks Related to background tasks, Docket, SEP-1686.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completed task results become unavailable after removing the originating tool

3 participants