Commit Graph

4 Commits

Author SHA1 Message Date
Flowershangfromthebranches 5ac47f412f fix: deduplicate agent IDs when profiles share the same name
_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]
2026-06-10 09:29:40 +08:00
Flowershangfromthebranches 1a9ec7c717 fix: unify profile ID normalization with fallback chain
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]
2026-06-10 09:16:22 +08:00
Flowershangfromthebranches 37efbe3473 Add agent web interaction console 2026-06-10 08:34:28 +08:00
Flowershangfromthebranches 300c79e13f Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00