瀏覽代碼

docs: plan first reply protocol matrix fixes

Problem: The initial comparison matrix could pass without a fast ChatAgent first reply and discarded the mode-specific model request surface.

Risk: Stronger ordering assertions must distinguish deterministic templates from additional model answers without coupling to the full audit sequence.
zhenyu.hu 2 周之前
父節點
當前提交
b8476ae05d
共有 2 個文件被更改,包括 28 次插入0 次删除
  1. 27 0
      docs/plans/todo-51.1-first-reply-and-protocol-matrix.md
  2. 1 0
      docs/plans/todos.md

+ 27 - 0
docs/plans/todo-51.1-first-reply-and-protocol-matrix.md

@@ -0,0 +1,27 @@
+# Todo 51.1 First Reply and Protocol Matrix Plan
+
+**Status:** in_progress
+
+## Goal
+
+Make the closeout matrix enforce the experiment's primary latency contract and the intended mode-specific protocol surfaces.
+
+## Scope
+
+- Add a ChatAgent `message_delta` before events for volume, schedule, terminate, web search, and parallel volume/schedule scenarios.
+- Assert first visible reply precedes the first tool result; silent/terminate flows do not add an unintended second model answer; schedule/parallel add exactly one deterministic template after execution.
+- Record each scripted model request.
+- For `dual_agent`, assert the initial ChatAgent request has no provider tools and includes the compact enabled event catalog.
+- For `chat_agent_tools`, assert the initial request contains exactly the enabled provider schemas and no generated event catalog.
+- Assert detected event audit source is `text_event` for dual mode and `provider_resolved` for direct mode.
+
+## Files
+
+- Modify: `tests/test_tool_invocation_comparison.py`
+
+## Verification
+
+- `uv run pytest tests/test_tool_invocation_comparison.py -q`
+- repeat parallel cases
+- `uv run pytest`
+- `git diff --check`

+ 1 - 0
docs/plans/todos.md

@@ -99,3 +99,4 @@
 | 50 | done | `docs/plans/todo-50-comparable-model-tool-metrics.md` | Record mode-aware model/tool spans and include EventAgent usage so both architectures can be compared fairly. | Persistence/API tests report agent, call kind, tokens, TTFT, tool latency, fallback usage, and total turn wall time without double counting. |
 | 50.1 | done | `docs/plans/todo-50.1-metric-key-migration-dedup.md` | Deduplicate legacy metric keys before creating the idempotency index so existing experiment databases remain openable. | Migration keeps the earliest row for each duplicate non-null session/metric key, creates the unique index, and remains safe under concurrent initialization. |
 | 51 | in_progress | `docs/plans/todo-51-comparison-matrix-closeout.md` | Add repeatable comparison fixtures, update project documentation, and close the experimental implementation. | Both modes pass the same scenario matrix; full tests, JS syntax, app import, and documentation checks pass. |
+| 51.1 | in_progress | `docs/plans/todo-51.1-first-reply-and-protocol-matrix.md` | Require fast visible first replies for event scenarios and prove each mode uses its intended capability protocol surface. | Matrix asserts first reply ordering, no unintended second reply, dual compact event catalog/no provider tools, direct enabled schemas/no generated event catalog, and correct event source. |