_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]
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]