···5566import asyncio
77import importlib
88-import io
99-import sys
108from unittest.mock import AsyncMock, patch
1191212-import pytest
1313-import typer
1410from typer.testing import CliRunner
15111612from think.call import call_app
···211207 result = runner.invoke(call_app, ["handoff", "coder"], input="")
212208213209 assert result.exit_code == 1
214214- assert "no prompt" in result.output.lower() or "no prompt" in (
215215- result.stderr or ""
216216- ).lower()
210210+ assert (
211211+ "no prompt" in result.output.lower()
212212+ or "no prompt" in (result.stderr or "").lower()
213213+ )
217214218215 def test_handoff_whitespace_only_stdin(self):
219216 """Whitespace-only stdin produces error."""
···224221 @patch("think.cortex_client.cortex_request", return_value=None)
225222 def test_handoff_cortex_failure(self, mock_cortex):
226223 """When cortex_request returns None, handoff reports error."""
227227- result = runner.invoke(
228228- call_app, ["handoff", "coder"], input="Fix the bug\n"
229229- )
224224+ result = runner.invoke(call_app, ["handoff", "coder"], input="Fix the bug\n")
230225231226 assert result.exit_code == 1
232232- assert "failed" in result.output.lower() or "failed" in (
233233- result.stderr or ""
234234- ).lower()
227227+ assert (
228228+ "failed" in result.output.lower()
229229+ or "failed" in (result.stderr or "").lower()
230230+ )
235231236232237233# ---------------------------------------------------------------------------
···251247252248 def test_coder_frontmatter(self):
253249 """coder.md must have write: true and type: cogitate."""
250250+ from pathlib import Path
251251+254252 import frontmatter
255255- from pathlib import Path
256253257254 coder_path = Path(__file__).parent.parent / "muse" / "coder.md"
258255 post = frontmatter.load(coder_path)
+4-1
think/agents.py
···1319131913201320 for provider_name in providers:
13211321 for tier in tiers:
13221322- if targeted_pairs is not None and (provider_name, tier) not in targeted_pairs:
13221322+ if (
13231323+ targeted_pairs is not None
13241324+ and (provider_name, tier) not in targeted_pairs
13251325+ ):
13231326 continue
13241327 model = PROVIDER_DEFAULTS[provider_name][tier]
13251328 for interface_name in interfaces: