Skip to content

Keep legacy Tool context across wait boundaries - #957

Draft
Y1fe1Zh0u wants to merge 2 commits into
dataelement:002-tool-runtime-contractfrom
Y1fe1Zh0u:fix/legacy-tool-context-persistence
Draft

Keep legacy Tool context across wait boundaries#957
Y1fe1Zh0u wants to merge 2 commits into
dataelement:002-tool-runtime-contractfrom
Y1fe1Zh0u:fix/legacy-tool-context-persistence

Conversation

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator

Summary

  • propagate a reconstructed legacy StepToolContext through ordinary wait and error exits
  • preserve the same accepted Workset across unknown and A2A resume paths
  • prevent resumed legacy calls from rebuilding the ToolProvider view

Validation

  • 68 Tool Step tests passed
  • targeted legacy unknown-wait and A2A-tail resume regressions passed
  • scoped Ruff and git diff checks passed

Boundaries

Set the existing protocol repair, safe-read replay, and model-visible Tool episode limits to ten while preserving their current independent state and execution semantics. Update focused tests and planning artifacts to make the off-by-one behavior explicit.

Constraint: Tool-related retry and repair limits must be ten without restructuring the existing counters

Rejected: Unify protocol, Receipt, and model-visible repair state now | counter redesign is intentionally deferred

Confidence: high

Scope-risk: moderate

Directive: Keep the independent counters until the planned repair-control refactor; do not infer identical attempt semantics from the shared numeric limit

Tested: 911 Runtime and Tool pytest cases; scoped Ruff; fatal-level caller Ruff; py_compile; git diff --check

Not-tested: Live Provider credentials
Legacy checkpoints now return the reconstructed StepToolContext from every ordinary wait, unknown, A2A, group failure, and error exit. A resumed Tool node therefore reuses the accepted Workset instead of querying the current ToolProvider again.

Constraint: Async poll continuation remains owned by the dedicated async-context repair.

Rejected: Mutate graph state directly inside ToolStepService | would bypass the existing ToolStepResult checkpoint boundary.

Confidence: high

Scope-risk: narrow

Directive: Any new ToolStep early return after legacy context resolution must propagate step_tool_context.

Tested: 68 Tool Step tests plus targeted legacy unknown and A2A resume regressions; scoped Ruff; git diff --check.

Not-tested: Production checkpoint database restart and legacy approval fixture outside current canonical schemas.
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