Skip to content

test: add integration test for tool result with no executor (server restart recovery) #769

@BlueHotDog

Description

@BlueHotDog

Context

When the server restarts mid-execution, the executor process dies but tool results may still arrive from the client. Tasks.add_tool_result returns {:ok, interaction, :no_executor} in this case. The channel then checks Interaction.all_pending_tools_resolved?/1 to decide whether to resume the agent. This critical recovery path has no test coverage.

Missing Invariant

Tool results arriving after executor death must:

  1. Be persisted successfully
  2. Return :no_executor status
  3. Trigger agent resume when all pending tools are resolved

Proposed Test

  1. Start an agent with an interactive tool call
  2. Kill the executor process (simulating server restart)
  3. Submit the tool result via Tasks.add_tool_result
  4. Assert the return is {:ok, _interaction, :no_executor}
  5. Optionally verify all_pending_tools_resolved? returns true and the agent can be re-started

File

apps/frontman_server/test/frontman_server/tasks/execution_test.exs

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