todo-23-agent-prompt-and-event-llm.md 2.5 KB

Todo 23 Agent Prompt and EventAgent LLM Plan

Status: done

Goal

Move prompt configuration into Agent configuration and make EventAgent use a real LLM tool-call step to generate tool parameters.

Why

Prompt Config is a separate modal while ChatAgent already owns the prompt that shapes visible replies. This splits one concept across two places. EventAgent also still resolves mock parameters locally; the target design requires EventAgent to use conversation context plus the selected event tool schema to ask the LLM for real arguments before executing tools.

Scope

  • Remove the standalone Prompt Config button and modal.
  • Move prompt set management, system prompts, and pre-messages into the ChatAgent config modal.
  • Show the generated available-event protocol prompt in ChatAgent prompt by default.
  • Keep ChatAgent free of provider tools.
  • Restore provider tool_calls parsing for EventAgent LLM parameter generation only.
  • Make EventAgent call the LLM with only the corresponding event tool schema, then execute the returned arguments through the registry.
  • Run multiple EventAgent events concurrently.

Implementation

  • Removed the standalone Prompt Config modal and moved prompt-set, system prompt, and pre-message controls into ChatAgent config.
  • Added a generated available-event protocol prompt from the selected tools and populated it into ChatAgent system prompt by default.
  • Kept ChatAgent provider calls tool-free while preserving text event extraction from delta.content.
  • Restored provider tool_calls parsing for EventAgent LLM requests.
  • EventAgent now calls the LLM with exactly the selected event tool schema, then executes the returned arguments.
  • EventAgent handles multiple events concurrently with asyncio.gather.

Verification

  • Parser test proves provider tool_calls still become internal events for EventAgent.
  • EventAgent tests prove it calls the LLM with the target tool schema, passes history/config, and executes generated arguments.
  • Static UI tests prove Prompt Config is gone and prompt controls live in ChatAgent config.
  • Runtime tests continue to prove ChatAgent receives no tools or tool role history.
  • uv run pytest passes (51 passed, one existing Starlette deprecation warning).
  • UV_CACHE_DIR=.uv-cache uv run python -m py_compile ... passes for the changed Python modules.
  • Local server started and returned the page, static assets, and /api/tools; browser automation timed out during click verification, so modal click behavior is covered by static binding tests rather than a completed browser click run.