Skip to content

fix(core): attach input to ExecutionContext for middleware and interceptors - #346

Open
xiechimon wants to merge 1 commit into
nitrocloudofficial:mainfrom
xiechimon:fix/context-input-in-execution-context
Open

xiechimon wants to merge 1 commit into
nitrocloudofficial:mainfrom
xiechimon:fix/context-input-in-execution-context

Conversation

@xiechimon

Copy link
Copy Markdown

Description

Tool arguments were never attached to ExecutionContext, so middleware and
interceptors could not inspect the actual input (context.input was always
undefined). This contradicts the SDK reference and Interceptor guide, both
of which show context.input as the canonical way to read tool arguments
in cross-cutting logic.

Changes Made

  • Add optional input field to the ExecutionContext interface (types.ts)
  • Populate context.input with the sanitised tool arguments at both call
    sites in server.ts (synchronous path and runTaskAsync)
  • _meta is excluded from input as it already lives in context.metadata

Type of Change

  • fix: Bug fix

Related Issues

Closes #328

Testing

  • npm test — 708 tests pass, 60 suites green
  • Added test: verifies context.input is populated with tool args
    and _meta is correctly excluded

Copilot AI lite review requested due to automatic review settings September 15, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

bug: docs show context.input in middleware/interceptors, but tool arguments never reach the ExecutionContext

2 participants