添加可选的代理引擎 / 无 API 密钥模式,同时保留旧有的 API 密钥工作流。#683
Open
Flowershangfromthebranches wants to merge 4 commits into
Open
添加可选的代理引擎 / 无 API 密钥模式,同时保留旧有的 API 密钥工作流。#683Flowershangfromthebranches wants to merge 4 commits into
Flowershangfromthebranches wants to merge 4 commits into
Conversation
When profiles.json lacks agent_id/user_id fields, the backend and Web Console would fall back to empty strings or "unknown", breaking agent routing and dropdown rendering. Add _resolve_agent_id() (Python) and _resolveId() (JS) implementing a unified fallback chain: agent_id → user_id → name slug → positional agent_N. Applied consistently across list_agents, get_agent, send_questionnaire, _simulation_round_structured_input, _profiles_summary, and Web Console embedded data normalization. Web Console now refreshes the dropdown from the API when online (authoritative backend IDs), with normalized embedded profiles as offline fallback. Add 12 new tests covering: resolve logic, list_agents/get_agent/ask_agent fallback IDs, and Web Console HTML generation (no "unknown" values, embedded profiles carry agent_id). 98 passed, 0 failed. Provider boundary check passed. 🤖 Generated with [Qoder][https://qoder.com]
_resolve_agent_id() produced identical slugs for same-named profiles (e.g. two "Baidu" → both "baidu"), causing dropdown selection to always hit the first match. Add _resolve_all_agent_ids() which runs the same base resolution but appends _2, _3, … suffixes on collision, guaranteeing every ID in the returned list is unique. Applied across all call sites: list_agents, get_agent, send_questionnaire, _simulation_round_structured_input, _profiles_summary, and Web Console embedded data. JS template mirrors the same dedup logic client-side. 105 passed, 0 failed. Provider boundary check passed. 🤖 Generated with [Qoder][https://qoder.com]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
此 PR 为不想提供模型 API 密钥的 MiroFish 用户添加了可选的代理驱动执行路径。
要点:
验证运行:
uv 运行 pytest -qbash 脚本/smoke_agent_queue_full.shbash 脚本/smoke_agent_queue_staged.shbash 脚本/smoke_mcp_full.shpython 脚本/check_provider_boundaries.py这是为了添加无 API 密钥代理模式,而不是删除现有的 API 密钥工作流程。
无 API key 用户:
桌面 agent -> MCP/CLI -> agent_queue -> 外部 agent 写 response -> MiroFish 继续运行
有 API key 用户:
原 API/legacy provider -> openai_compatible / zep -> 原交互路径
已在trae上试运行,功能完整