MicroFish/backend/tests
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
..
test_agent_deps_and_doctor.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
test_agent_interaction.py fix: unify profile ID normalization with fallback chain 2026-06-10 09:16:22 +08:00
test_agent_mode_boundaries.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
test_agent_queue.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
test_camel_adapter.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
test_graph_provider.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
test_runner_cli_flow.py Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00