Skip to content

Users stop receiving agent responses after refreshing the page during a client tool call #107

@pstepaniuk

Description

@pstepaniuk

Summary

Following the previously reported and now resolved issue (#96) that caused users to stop receiving agent responses (thanks again for fixing it!), we have identified another scenario that can lead to the same problem.

This consistently occurs when a user sends a chat message that makes the agent workflow call a client tool, and the user refreshes the page before the client tool call completes.

As a result, when the user returns to the same thread, they stop receiving agent responses, and the following error is logged for the workflow's first Agent node:

Error code: 400 - {'error': {'message': 'No tool output found for function call <call ID>', 'type': 'invalid_request_error', 'param': 'input', 'code': None}}

Expected Behavior

Users should continue to receive agent responses after refreshing the page at any time.

Minimal Reproducible Example

  1. Use Agent Builder to create and publish a simple workflow with a single Agent node (e.g. gpt-5.1) that has a client tool configured.

    📸 Example Image
  2. Use a basic ChatKit configuration that:

    • Includes a client tool handler that takes at least a few seconds to complete (for easier reproduction)
    • Sets the initial thread to the previously used thread ID when the page is refreshed (for extra convenience - optional)
    const { control: chatKitControl } = useChatKit({
      api: {
        getClientSecret,
      },
      onClientTool: async (tool) => {
        // Simulate tool processing delay
        await new Promise((resolve) => setTimeout(resolve, 10_000));
    
        return {
          toolCalled: tool.name,
        };
      },
      initialThread,
      onThreadChange: handleThreadChange,
    });
  3. Start a brand-new thread via the ChatKit UI.

  4. In the first user message, prompt the agent to trigger the client tool, and refresh the page as soon as the tool starts executing.

    📸 Example Image
  5. Observe that subsequent user messages no longer receive agent responses and the Agent node errors are logged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions