Repository navigation
Conversation
…hrough tool calls and the Python bridge Generated-by: Codex 0.164 (gpt-6)
Generated-by: Codex 0.164 (gpt-6)
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.
Linked issue: #1322 (second item only)
Purpose of change
Preserve framework faults from internal subagent calls, including their original causes. These faults currently become failed tool responses and can then be masked by an unresolved-handle error.
This PR addresses the second item only. Group cleanup, ordinary future/gather behavior, and model routing/retry policies are unchanged.
Runtime flow
Internal call operations and ActionState writes mark framework faults with
UncapturableException.FunctionTool,ToolCallAction, subgraph execution, and durable recording propagate that marker through wrapped causes. The Python bridge carries the Java Throwable or Python error details back to Java before result conversion.Key decisions
UncapturableExceptionmoves toplan.exceptionsso plan and runtime share the classification. Python uses an internal counterpart and a per-call return envelope because Pemja otherwise loses the type and cause.Behavioral Semantics
Interaction decisions
SubagentResultBehavioral contracts
Nested calls retain the framework cause. Recovery can reuse completed child work and retry unfinished work after the storage fault is removed. Ordinary tool failures keep their existing handling, and user return values cannot be mistaken for bridge faults.
Failure behavior
Marked faults fail the Action through the existing runtime path; no retry policy is added. Cancellation, interruption and fatal errors retain their handling. Invalid bridge envelopes raise framework faults. Interpreter close still runs if dispatcher cleanup fails, retaining the first failure and suppressing a later close failure. User catch blocks can still handle exceptions.
Tests
FunctionToolTest,ToolCallActionSubagentTest; Pythontest_tool_call_action.pyandtest_subagent_await_cleanup.pyInternalSubagentFrameworkFaultTest,FrameworkFaultBridgeTestSubgraphInvocationTestFrameworkFaultBridgeTestPythonFaultBridgeTestNot verified: distributed-cluster fault injection, external model-service E2E, or Python 3.10/3.12. Python-child operator tests require JDK 21; the existing JDK 17 restriction is unchanged.
Validation details
git diff --checkJava:
env -u OPENAI_API_KEY ./tools/ut.sh -j, with live OpenAI tests skipped. Python: pytest withnot e2e_testsandnot integration, matching thetools/ut.sh -pselection.Classification uses explicit causes. The bridge envelope belongs to one call and never enters the journal; ordinary Python exceptions retain Pemja's exception path. Attribute lookup and close-time cleanup manage the dispatcher's references.
API
No user-facing API signatures or YAML options change. The internal
UncapturableExceptionmoves fromruntime.operator.paralleltoplan.exceptions; code importing it must update imports and recompile.Documentation
doc-neededdoc-not-neededdoc-includedWas this patch authored or co-authored using generative AI tooling?
Generated-by: Codex 0.164 (gpt-6)