Skip to content

Add global /feedback SDK tool available in every session #678

Description

@jeremyeder

Jira: RHOAIENG-51910

Summary

Users need a way to submit platform feedback from any ACP session, regardless of which workflow is active. Today, slash commands are scoped to the active workflow's .claude/commands/ directory, so a /feedback command in the feedback workflow is only available in feedback sessions.

Problem

  • Session workflows can't be changed after they start
  • Commands are loaded exclusively from the active workflow's .claude/commands/*.md via ContentWorkflowMetadatafindActiveWorkflowDir
  • There is no mechanism for global/cross-workflow commands
  • The feedback workflow exists at workflows/feedback/ in ambient-code/workflows but its /feedback command is unreachable from other workflow sessions

Proposed Solution

Add a submit_feedback SDK tool using the @sdk_tool pattern already established by restart_session in components/runners/claude-code-runner/adapter.py.

Implementation Details

File: components/runners/claude-code-runner/adapter.py

Pattern to follow: The restart_session tool in _run_claude_agent_sdk():

  1. Define a function decorated with @sdk_tool (from claude_agent_sdk.tool):
@sdk_tool(name="submit_feedback", description="Submit user feedback about the Ambient Code Platform. Use this when the user runs /feedback or wants to share feedback about the platform.")
async def submit_feedback_tool(feedback: str, category: str = "other") -> str:
    """
    Parameters:
        feedback: Summary of the user's feedback
        category: One of: bug, feature, idea, other
    """
    # POST to the existing /feedback FastAPI endpoint
    # or call the feedback submission logic directly
    ...
    return "Feedback submitted. The team reviews feedback weekly."
  1. Add to the existing "session" MCP server created via create_sdk_mcp_server:
session_tools_server = create_sdk_mcp_server(
    "session",
    tools=[restart_session_tool, submit_feedback_tool]
)
  1. The tool is then automatically available in every session via ClaudeAgentOptions.mcp_servers.

Existing infrastructure to leverage

  • FastAPI endpoint: components/runners/claude-code-runner/main.py already has a /feedback endpoint that handles user feedback
  • Platform feedback API: POST /api/projects/{project}/agentic-sessions/{session}/agui/feedback
  • SDK tool pattern: restart_session in adapter.py demonstrates exactly this pattern

Behavior

When a user says /feedback (or "I want to give feedback") in any session:

  1. Claude asks what's on their mind
  2. Summarizes with a category (bug / feature / idea / other)
  3. Shows the summary and asks for confirmation
  4. Calls the submit_feedback SDK tool
  5. Confirms: "Sent to the Ambient team. The team reviews feedback weekly."

What NOT to do

  • Do not modify ContentWorkflowMetadata or findActiveWorkflowDir — this isn't a workflow-scoped command
  • Do not add a "global commands" directory concept — the SDK tool pattern is simpler and already proven
  • Do not clone the feedback workflow repo — the tool is self-contained

Key Files

File Role
components/runners/claude-code-runner/adapter.py ClaudeCodeAdapter._run_claude_agent_sdk() — where restart_session is defined and SDK tools are registered
components/runners/claude-code-runner/main.py Existing /feedback FastAPI endpoint
components/backend/handlers/content.go ContentWorkflowMetadata / findActiveWorkflowDir (for reference only — don't modify)

Acceptance Criteria

  • submit_feedback SDK tool exists and is registered in the "session" MCP server
  • Tool is available in every ACP session regardless of active workflow
  • Feedback is submitted to the platform feedback API
  • User sees confirmation after submission
  • No changes to workflow command loading (content.go)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ambient-code:auto-fixAmber agent: automated low-risk fixes (formatting, linting)stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions