You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp-adapter): expose MCP tool results to LLM;feat(plugin):improve result system (#526)
* feat(plugin): replace parse_plugin_result with build_plugin_reply_event
- Remove parse_plugin_result import and _lookup_llm_result_fields function
- Add build_plugin_reply_event import and implement _emit_plugin_completion_reply
- Integrate new reply contract utilities in task_executor for structured plugin responses
- Centralize plugin reply formatting and emission logic for consistency
* feat(mcp-adapter): enhance tool result handling with structured payloads
- Add `Any` to typing imports for improved type annotations
- Refactor tool call response handling to use `_build_mcp_tool_payload()` method
- Return structured payload via `finish()` with summary and metadata
- Add helper methods for content description and result summarization:
- `_truncate_llm_text()` for text truncation
- `_string_field()` for safe string conversion
- `_describe_mcp_content_item()` for content type formatting
- `_summarize_mcp_result()` for result summarization
- Improve response consistency and provide better context for downstream processing
* 1
* 1
* refactor: simplify plugin reply system, remove overengineered reply_contract
- Delete reply_contract.py (312 lines), plugin_reply.py (117 lines),
test_plugin_reply_contract.py (224 lines) — candidate election system
was solving a problem that doesn't exist (no plugin produces multiple
competing exports)
- Use existing llm_result_fields mechanism for field filtering:
- Add llm_result_fields param to register_dynamic_entry()
- MCP adapter declares llm_result_fields=["summary"] at registration
instead of agent.fields at finish() time
- Keep reply=True/False on finish() but implement as simple bool check
(_is_reply_suppressed) instead of AgentReplySpec/ReplyCandidate pipeline
- Restore _lookup_llm_result_fields + parse_plugin_result in agent_server
(proven, simpler path)
- Revert proactive_bridge to original simple logic
- Add ja docs for reply control and llm_result_fields
- Simplify en/zh-CN/ja docs and PLUGIN_DEVELOPMENT_GUIDE
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: _is_reply_suppressed reads meta from correct object; propagate llm_result_fields through IPC
- _is_reply_suppressed now receives full result dict (which contains
meta at root level) instead of result.data (which doesn't)
- _notify_dynamic_entry_registered includes llm_result_fields in the
ENTRY_UPDATE payload so it survives IPC to the host process
- communication.py passes llm_result_fields through metadata dict
when reconstructing EventMeta from IPC, matching the existing
query_service transparent path
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: propagate meta from plugin_result to result_obj
result_obj was missing the meta field from plugin_result, so
_is_reply_suppressed could never read meta.agent.reply from
the completion result. Add meta to the result_obj dict.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Hongzhi Wen <wenguanjung@aliyun.com>
Co-authored-by: Hongzhi Wen <cartabio.coder1@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use `llm_result_fields` on `@plugin_entry` (static entries) or `register_dynamic_entry()` (dynamic entries) to control which fields of the result the main LLM can see. Fields not listed are excluded from the LLM prompt but still stored in the task registry.
0 commit comments