Add get_task_tracebacks method to expose stored tracebacks for Tasks#482
Open
Add get_task_tracebacks method to expose stored tracebacks for Tasks#482
Conversation
…347) Adds the ability to retrieve traceback information from failed Tasks: - Add `Neo4jStore.get_task_tracebacks()` method to statestore - Add `/tasks/{task_scoped_key}/tracebacks` API endpoint - Add `AlchemiscaleClient.get_task_tracebacks()` client method - Add integration tests for all layers The method returns a list of dictionaries, one per failed ProtocolDAGResultRef, mapping ProtocolUnitFailure GufeKey to traceback string. Closes #347 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add `str` type annotation to task_scoped_key parameter in API endpoint - Clarify in docstrings that empty list is returned for non-existent tasks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #347 - Expose ability to get stored tracebacks associated with a given
Task.This PR adds a new method
get_task_tracebacks()at all layers of the alchemiscale stack:Neo4jStore.get_task_tracebacks(task: ScopedKey)- queries Neo4j for Tracebacks nodes associated with failed ProtocolDAGResultRefs for the given TaskGET /tasks/{task_scoped_key}/tracebacks- new endpoint that returns traceback dataAlchemiscaleClient.get_task_tracebacks(task: ScopedKey)- convenient client method for usersReturn Format
Returns a list of dictionaries, one per failed
ProtocolDAGResultRefassociated with the Task. Each dictionary mapsProtocolUnitFailureGufeKeystrings to their corresponding traceback strings:[ { "ProtocolUnitFailure-ABC123": "Traceback (most recent call last):\n ...", "ProtocolUnitFailure-DEF456": "Traceback (most recent call last):\n ..." }, # ... more entries if task has multiple failed results ]Results are ordered by
ProtocolDAGResultRef.datetime_createdin descending order (newest first).Example Usage
Test plan
test_get_task_tracebacks,test_get_task_tracebacks_no_failures,test_get_task_tracebacks_multiple_failures)test_get_task_tracebacks,test_get_task_tracebacks_no_failures)🤖 Generated with Claude Code