- Solr Expert Agent: Tests pass (
TP-004,TP-005)- Direct Solr querying
- Verification workflow
- Test Plan: Documented in
TEST_PLAN.md - Test Structure: Proper pytest organization
- Claude Agent SDK: All tests fail with "Command failed with exit code 1"
- Affects:
TP-001,TP-002,TP-003,TP-006,TP-007,TP-008 - Issue: Claude CLI subprocess fails when invoked via pytest
- Works: Same code works fine in standalone scripts
- Affects:
Symptom: Claude Agent SDK fails when called from pytest but works in standalone scripts.
Error:
Exception: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
Investigation:
- ✅ Simple prompts work standalone
- ✅ Long prompts work standalone
- ✅ Class methods work standalone
- ✅ Location (src/ vs tests/) doesn't matter for standalone
- ❌ ALL Claude SDK calls fail under pytest
Root Cause: Unknown - likely related to:
- Pytest's process/environment handling
- Subprocess spawning under pytest
- Missing
.claude_config.json(but standalone works without it)
Two options:
- Skip Claude tests in pytest: Mark with
@pytest.mark.skip(reason="Claude SDK pytest issue") - Use standalone agents:
agents_standalone.py(copy of src/ agents in tests/)
# Run all tests (Solr tests will pass, Claude tests will fail)
source .env && uv run pytest tests/agents/ -v
# Run only Solr tests
source .env && uv run pytest tests/agents/ -k "Solr" -v
# Skip failing Claude tests
source .env && uv run pytest tests/agents/ -v --ignore-glob="*claude*"- Option A: Debug Claude Agent SDK subprocess issue under pytest
- Option B: Switch to Anthropic Python SDK (simpler, no subprocess)
- Option C: Accept limitation and document workaround
Recommendation: Option B - Use Anthropic Python SDK directly for simpler, more reliable testing.