- Initialize asyncio_decoupling_refactor_20260306 track - Initialize mock_provider_hardening_20260305 track - Initialize simulation_fidelity_enhancement_20260305 track - Update TASKS.md and tracks.md to reflect new strict execution queue - Archive completed tracks and remove deprecated test performance track
1.2 KiB
1.2 KiB
Specification: Mock Provider Hardening
Background
The current mock_gemini_cli.py provider only tests the "happy path". It always returns successfully parsed JSON-L responses, which masks potential error-handling bugs in ai_client.py and AppController. To properly verify the system's robustness, the mock must be capable of failing realistically.
Objective
Extend mock_gemini_cli.py to support negative testing paths, controlled via an environment variable MOCK_MODE.
Requirements
- MOCK_MODE parsing: The mock script must read
os.environ.get("MOCK_MODE", "success"). - malformed_json: If mode is
malformed_json, the mock should print a truncated or syntactically invalid JSON string tostdoutand exit. - error_result: If mode is
error_result, the mock should print a valid JSON string but with"status": "error"and an error message payload. - timeout: If mode is
timeout, the mock shouldtime.sleep(120)to force the parent process to handle a subprocess timeout. - Integration Tests: New tests must be written to explicitly trigger these modes using
ApiHookClientand verify that the GUI displays an error state rather than crashing.