Skip to content

Feature: Add direct tool call API for E2E testing #80

@tryweb

Description

@tryweb

Problem

Currently, there's no way to directly call plugin tools like memory_remember for E2E testing. The available options are:

  1. LLM-driven tool calls - Tools are only triggered by LLM decisions during conversation
  2. HTTP Message API - Returns empty body (streaming issue)
  3. Async API - Returns 204 but doesn't process messages properly

This makes it impossible to verify plugin functionality through automated tests.

Proposed Solution

Add a direct tool call API endpoint:

POST /experimental/tool/{toolId}/execute
{
  "args": { /* tool arguments */ },
  "context": {
    "worktree": "/path/to/worktree",
    "sessionID": "optional-session-id"
  }
}

This would allow:

  • Direct verification of tool functionality
  • Automated E2E tests without LLM dependency
  • Consistent testing regardless of LLM availability

References

Example Use Case

# E2E test for memory plugin
curl -X POST http://localhost:4096/experimental/tool/memory_remember/execute \
  -H "Authorization: Basic $(echo -n 'opencode:password' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "args": {
      "text": "Test memory",
      "category": "testing"
    },
    "context": {
      "worktree": "/home/user/project"
    }
  }'

This would return the tool execution result directly, enabling automated testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions