Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…d_manager Mechanical ruff check --fix plus format for the 11 errors keeping python-quality red on main (same as stalled google#30/google#67). Split out from the google#129 feature for scope discipline.
Implements google#129: optional llm_model/llm_provider override flowing POST /api/run -> task queue -> worker CLI -> per-task ArtemisContext -> _resolve_endpoint (precedence: task override > artemis.jsonc node > default). No global config mutation, no restart.
- Wire batch lane (--model/--provider through submit_batch_to_daemon and standalone run_batch_tasks, per-goal requests) - Fail fast on provider-without-model (builder ValueError, API 422, MCP pre-trace) instead of dying mid-task - Client: per-call override only (drop constructor defaults), provider lower-cased - Document fallback pinning; comment idempotent-retry setdefault - Tests: real-LLMConfig isolation, provider-only/invalid/Flash cases, run_task forwarding, batch override
Write llm_model/llm_provider into the schemaless device_info dict at
session creation (worker side, run_tuning precedent; no migration),
prefer them in model_service over the inferred/global model, and echo
them from GET /api/sessions/{id} so TaskResult.llm_model resolves in
production. Legacy rows fall back to current behavior.
Do not restore a previous override from localStorage: every task starts from the server default unless set for that task. Stale keys from earlier versions are dropped on load.
get_status() consults the session row override even when the worker set an active profile (single row fetch, no new queries); the session list prefers a stored override when no profile resolves. Rename profile_sess_row to sess_row_for_model.
Queue cards display the requested override (llm_model/llm_provider now flow through the status mapping); the session merge prefers the stored model_info over the global active model; a successful submit clears the override fields so the next task starts from defaults.
The second get_status() return path rebuilt model_info from the connection profile alone; it now reuses the session row (or one indexed lookup) and prefers a stored llm_model/llm_provider, with trace lookups still skipped on this path.
History loops get the same conditional model badge as queue cards; getTaskModelLabel falls back to the persisted session model_info when no explicit override keys are present.
Pending tasks without an override have no session row yet, so the badge had no data. getTaskModelLabel now chains explicit override -> session model_info -> global activeModel, showing the model the task will resolve at dispatch.
Single normalize_llm_override() helper (artemis/config/llm_override.py) replaces six copies; TaskResult echoes llm_provider; new GET /api/llm-options serves providers, presets and the configured default.
One shared getTaskModelLabel util; badges distinguish scheduled vs ran-with via title/aria; Prompt Dock gains a preset/provider dropdown backed by /api/llm-options with free-text fallback.
Rebuild the presets inventory test as a shape-only smoke test; fix the helper docstring coverage claim; stringify non-string override input in the client mirror.
Uzzoper
force-pushed
the
feat/per-task-llm-override
branch
from
September 26, 2026 17:15
824560f to
58d8624
Compare
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #129 with a small initial scope: a single optional override parameter, no settings UI, no global config mutation, no restart.
How it works
llm_model/llm_providerflowPOST /api/run→enqueue_tasks(one sharednormalize_llm_override()helper: trim/lowercase, blank → None, provider-requires-model fail-fast) → persisted queue item → worker--model/--providerflags →TaskRequestBuilder.with_llm_override()→ per-taskArtemisContext→_resolve_endpointprecedence: task override > artemis.jsonc node > built-in default.get_llm()is the single funnel, so every model the task resolves is covered; the sharedLLMConfigis never mutated.Entry points
GET /api/llm-options(providers, jsonc presets, configured default; degrades to free-text on 404) + custom free-text fields. Empty = server default; strictly per-task (never restored, cleared on successful submit).model_infofallback), active dashboard, session detail — badges distinguish scheduled vs ran-with. Additive only, no restyle.ArtemisClient.submit/runper-call params; daemon + batch shims (artemis run/batch --model/--provider).mobile_run_task(llm_model, llm_provider)— named distinctly because existingmodel="Flash"means profile arch; background runner uses--llm-model/--llm-providerfor the same reason.device_info(no migration);GET /api/sessions/{id}echoes them soTaskResult.llm_model/llm_providerresolves in production.Also included (separate commit)
Fixes the 11 pre-existing ruff UP017/UP037/UP045 errors in
playground/backend_managerkeeping python-quality red on main — same mechanical fix as stalled #30/#67, needed for CI to go green here.Validation (local, Python 3.12)
ruff format --checkclean,ruff checkclean,quality_ratchet.pyat baseline (754/0/18),pyright --project pyright-core.json0 errorsinspect_traceorder flake test_mobile_inspect_trace_invalid_action passes or fails based on unrelated on-disk state #62, win32 flags test_ensure_emulator_uses_windows_creation_flags can only pass on Windows #97, adbtapdocstring drift), verified identical with changes stashedngcapp+spec clean via --rootDir workaround (repo tsconfig lacks rootDir for installed TS — pre-existing;npm run buildalso gated on Node version locally, CI covers it)Deliberate scope decisions (for reviewers)
LlmOverridecross-signature type yet; kept the pair convention (verification_level/explorer_modetravel the same way).Follow-ups (out of scope)
--llm-modelalias onartemis run.