Skip to content

Fix root pytest failures#360

Closed
namabeeru wants to merge 3 commits into
CraftOS-dev:devfrom
namabeeru:codex/fix-main-test-failures
Closed

Fix root pytest failures#360
namabeeru wants to merge 3 commits into
CraftOS-dev:devfrom
namabeeru:codex/fix-main-test-failures

Conversation

@namabeeru

Copy link
Copy Markdown
Contributor

Summary

  • Limit default root pytest discovery to the maintained tests/ suite.
  • Update the router test fake LLM to accept the current generate_response_async(..., prompt_name=...) call shape.
  • Assert the session router passes the ROUTE_TO_SESSION prompt name into the LLM call.

Root cause

Plain pytest from the repository root was collecting generated/template Living UI tests under app/data. Those tests are either intended to run from a generated backend project or from their own backend directory, not as part of CraftBot's root suite, so root collection failed before the maintained tests could run.

The router tests also had a stale fake LLM signature. Product code now passes prompt_name="ROUTE_TO_SESSION", which matches the current agent_core LLM implementation, but the fake rejected that keyword.

Validation

  • /usr/local/bin/python3.10 -m pytest tests/test_trigger_router_and_parking.py -q -> 9 passed
  • /usr/local/bin/python3.10 -m pytest --collect-only -q -> 99/115 tests collected (16 deselected)
  • /usr/local/bin/python3.10 -m pytest -q -> 99 passed, 16 deselected
  • Root pytest loop: 20/20 successful runs, each 99 passed, 16 deselected
  • /usr/local/bin/python3.10 -m pytest app/data/living_ui_template/backend/tests -q -> 4 passed when invoked explicitly
  • /usr/local/bin/python3.10 -m py_compile tests/test_trigger_router_and_parking.py -> passed
  • git diff --check HEAD^..HEAD -> passed

Note: Ruff is not installed in this local environment, so I could not run ruff format --check / ruff check locally.

CraftOS-dev and others added 3 commits July 3, 2026 12:25
CraftBot V1.4.0 update: Sub-agents, improved Memory system, improved agent workflow, and a big UI overhaul
🧩 CraftBot V1.4.0 update: Sub-agents, improved Memory system, improved agent workflow, and a big UI overhaul
@namabeeru namabeeru marked this pull request as ready for review July 3, 2026 11:45
@namabeeru namabeeru changed the base branch from main to dev July 3, 2026 13:43
@namabeeru

Copy link
Copy Markdown
Contributor Author

Retargeted this PR to dev to match the contributing guide (dev -> staging -> main).

@namabeeru

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #361, which contains the same two-file fix rebuilt from dev with a clean one-commit history and signoff.

@namabeeru namabeeru closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants