fix(pi): select configured startup models
test / unit (pull_request) Successful in 30s
test / integration (pull_request) Successful in 17s
lint / lint (push) Successful in 1m37s
test / unit (push) Successful in 33s
test / integration (push) Successful in 17s
Update Quality Badges / update-badges (push) Successful in 1m6s
test / unit (pull_request) Successful in 30s
test / integration (pull_request) Successful in 17s
lint / lint (push) Successful in 1m37s
test / unit (push) Successful in 33s
test / integration (push) Successful in 17s
Update Quality Badges / update-badges (push) Successful in 1m6s
This commit was merged in pull request #222.
This commit is contained in:
@@ -284,6 +284,7 @@ class TestAgentProviderRuntime(unittest.TestCase):
|
||||
("/home/node/.pi/agent/models.json",),
|
||||
tuple(f.guest_path for f in plan.files),
|
||||
)
|
||||
self.assertEqual(("--models", "ollama/qwen2.5-coder:7b"), plan.startup_args)
|
||||
provider = models["providers"]["ollama"]
|
||||
self.assertEqual("http://ollama:11434/v1", provider["baseUrl"])
|
||||
self.assertEqual("openai-completions", provider["api"])
|
||||
@@ -348,6 +349,10 @@ class TestAgentProviderRuntime(unittest.TestCase):
|
||||
[{"id": "google/gemma-4-26b-a4b-it:free"}],
|
||||
provider["models"],
|
||||
)
|
||||
self.assertEqual(
|
||||
("--models", "openrouter/google/gemma-4-26b-a4b-it:free"),
|
||||
plan.startup_args,
|
||||
)
|
||||
self.assertEqual("openrouter.ai", plan.egress_routes[0].host)
|
||||
self.assertEqual("Bearer", plan.egress_routes[0].auth_scheme)
|
||||
self.assertEqual("OPENROUTER_API_KEY", plan.egress_routes[0].token_ref)
|
||||
|
||||
@@ -80,5 +80,28 @@ class TestSettleState(_FakeHomeMixin, unittest.TestCase):
|
||||
start_mod.settle_state("") # should not raise
|
||||
|
||||
|
||||
class TestAttachAgent(unittest.TestCase):
|
||||
def test_passes_provider_startup_args(self):
|
||||
class Bottle:
|
||||
argv: list[str] = []
|
||||
|
||||
def exec_agent(self, argv: list[str], *, tty: bool = True) -> int:
|
||||
self.argv = list(argv)
|
||||
return 0
|
||||
|
||||
bottle = Bottle()
|
||||
exit_code = start_mod.attach_agent(
|
||||
bottle, # type: ignore[arg-type]
|
||||
agent_provider_template="pi",
|
||||
startup_args=("--models", "openrouter/google/gemma"),
|
||||
)
|
||||
|
||||
self.assertEqual(0, exit_code)
|
||||
self.assertEqual(
|
||||
["--models", "openrouter/google/gemma"],
|
||||
bottle.argv,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user