fix(reply): known user location reaches getWeather; retries are not blocked by the previous reply
- Drop the engine's deterministic Korean weather shortcut. It bypassed the chat model and the tool runner, so a location the user had stated could never be used. The tool already returns one clean Korean sentence. - getWeather and the tool-argument prompts pass the place the user has said they are (conversation or memory) and leave the argument empty otherwise, so the detected location is not copied into it. - getWeather retries a "district, city, country" name with its leading parts dropped when the geocoder finds nothing. - The planner gets the live time/location line and plans searchMemory topic='where the user lives' only when the location is unknown or disabled. - The per-reply repeat guard counts only this reply's tool messages, so calls carried over from the previous reply no longer block a retry the user asks for. - Memory extractor: the context block sits after the examples and the no-location example uses a different query, so a location already in context is not asked for again. New counterpart eval checks that it is still asked for when the context has none. - Tool retry eval fails every call in turn 1, so a model that retries by itself inside turn 1 still exercises the user's "try again". - Specs (planner, reply), docs/llm_contexts.md and the roadmap updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ Every distinct LLM call in Jarvis, what feeds it, what consumes it, and how it i
|
||||
- **File**: [src/jarvis/reply/enrichment.py](src/jarvis/reply/enrichment.py) — `extract_search_params_for_memory()` (~line 71).
|
||||
- **Trigger**: once per reply, **only when the pre-flight planner (#12) emitted a `searchMemory` directive or returned an empty plan (fail-open)**. Pure reply-only plans skip this entirely — saves one LLM call per greeting / small-talk turn.
|
||||
- **Model / gating**: resolved via `resolve_tool_router_model(cfg)` — `tool_router_model → intent_judge_model → ollama_chat_model`. Small classification task; rides the same small/warm model as the router. Silent empty-dict on failure.
|
||||
- **Inputs**: user query (with the planner's `topic` hint appended when present), optional context hint (live-context compact summary), UTC now.
|
||||
- **Inputs**: user query (with the planner's `topic` hint appended when present), optional context hint (live-context compact summary, placed after the examples so the model checks its questions against it last), UTC now.
|
||||
- **System prompt**: inline at [enrichment.py:35-63](src/jarvis/reply/enrichment.py:35).
|
||||
- **Output**: `{keywords, from?, to?, questions?}`. Consumed by memory search in the reply engine.
|
||||
- **Limits**: up to 2 retries; timeout from `llm_tools_timeout_sec`.
|
||||
@@ -158,7 +158,7 @@ Every distinct LLM call in Jarvis, what feeds it, what consumes it, and how it i
|
||||
- **File**: [src/jarvis/reply/planner.py](src/jarvis/reply/planner.py) — `plan_query()`.
|
||||
- **Trigger**: once per reply, **after the tool router and before memory search**. Skipped when `cfg.planner_enabled = False`, when the query is shorter than `MIN_QUERY_CHARS` (4), or when no model / base URL is available.
|
||||
- **Model / gating**: resolution chain `planner_model (override) → ollama_chat_model`. The planner tracks the chat model so upgrading the chat model (via setup wizard or config) automatically upgrades plan quality.
|
||||
- **Inputs**: user query, dialogue context, **router-narrowed** tool catalogue (names + one-line descriptions + argument names, built by `planner_tool_catalog()`) — not the full 30+ list. When the carry-over guard from #7 fires, the previous turn's failed tool name is unioned into this catalogue before the planner sees it, so the planner can plan a re-call without `toolSearchTool` round-tripping. **No** memory context — the planner decides *whether* memory is needed.
|
||||
- **Inputs**: user query, dialogue context, the live time/location line (`LIVE CONTEXT:`, so a location-dependent ask plans `searchMemory topic='where the user lives'` only when the location is unknown or disabled), **router-narrowed** tool catalogue (names + one-line descriptions + argument names, built by `planner_tool_catalog()`) — not the full 30+ list. When the carry-over guard from #7 fires, the previous turn's failed tool name is unioned into this catalogue before the planner sees it, so the planner can plan a re-call without `toolSearchTool` round-tripping. **No** memory context — the planner decides *whether* memory is needed.
|
||||
- **System prompt**: `_PROMPT_TEMPLATE` in `planner.py`. Teaches the `searchMemory topic='...'` directive for prior-conversation lookups, short imperative tool steps, angle-bracket entity placeholders, final synthesis step, same-language output, no numbering.
|
||||
- **Output**: list of plan steps (max `MAX_STEPS` = 5). Gates memory enrichment (#3 / #4) and augments the tool router (#7 — planner's picks are unioned in, not replacing). Single-step `["Reply to the user."]` plans are the planner's positive "no memory, no tools" signal. An empty list is fail-open — the engine reverts to running #3 unconditionally. Consumed further by the engine to build the `ACTION PLAN:` system-message block and drive the direct-exec loop (#13) for small models.
|
||||
- **Limits**: `planner_timeout_sec` (6s). Fail-open → `[]`.
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user