Skip to content

feat(chat): the planner runs as a chat-graph node with structured step state (#21023) - #21060

Closed
mrveiss wants to merge 9 commits into
issue-21024-agentloop-decision-ssotfrom
issue-21023-planner-graph-node
Closed

mrveiss wants to merge 9 commits into
issue-21024-agentloop-decision-ssotfrom
issue-21023-planner-graph-node

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #21024; retarget to main after it lands.

Thinking Path

The maintainer decision on #20846 (point 4b) ports the planner into the chat graph, the canonical loop. The planner becomes a graph node behind a flag, with the plan kept outside graph state so state stays small and serialisable.

What Changed

  • chat_workflow/graph_planner.py: the create_plan node, behind AUTOBOT_CHAT_PLANNER_ENABLED (default off; off returns at once and touches nothing).
  • The planner uses the turn's selected model (planner_client.py), under the existing 5-step cap (limits.py).
  • The plan body is stored in Redis; graph state carries only plan_id and current_step_id (plus a small progress dict).
  • The step advances after tool execution passes (plan_runner.py, PlanTracker).
  • The legacy path and delegation share plan_runner, so there is one implementation of plan creation and step advance.
  • No extra loop forcing: the plan informs the prompt; it does not add iterations or force tool calls.
  • No progress events are emitted; that is a follow-up.
  • Size refactors to make room: graph_hooks.py and kb_sources.py are extracted from graph.py / manager.py; ceilings lowered in scripts/python_file_size_known_large.py (graph.py 1459 to 1443, manager.py 3766 to 3750).
  • Env var documented in docs/developer/ENV_VARS.md and env_registry_agent_tools.py; the bug(agent-loop): AgentLoop, the planner and stall escalation are built but only tests construct them — two agent loops for one concept #20846 wiring guard gains 10 lines for the node.
  • Provider: the planner and the failover route now share configured_provider() (AUTOBOT_LLM_PROVIDER). An install that already sets a provider now gets it in failover and the planner too, where before both were hardcoded to Ollama. An unknown value falls back to ollama with one warning at config load (ssot_chat_graph_settings.py), because config.llm.provider is also read outside chat and failing fast could stop an existing install.
  • LLMPlannerModule rejects an empty key_scope; the legacy unscoped plan key is gone.
  • The _NO_REDIS_LOGGED flag is one of several hand-written log-once copies (5 private _warn_once helpers plus module-level flags); consolidation is tracked in refactor(logging): one shared log-once helper in autobot_shared.logging_manager, replace the private _warn_once copies #21071.

Verification

  • planner/planner_test.py (106 lines), chat_workflow/graph_planner_20846_test.py (124), chat_workflow/plan_runner_21023_test.py (111), chat_workflow/live_entry_uses_planner_20846_test.py (135, includes a control that the flag-off baseline run produced output) and repo_tests/agent_loop_ported_to_chat_graph_20846_test.py: 27 passed together.
  • Pre-push fast guards and reach floors passed; the full suites run in CI.

Single-issue rationale

The node, the shared plan_runner and the size refactors that make room for it cannot be split: the node does not fit under the graph.py ceiling without the extractions. It is stacked on #21024 for the SSOT settings it reads.

Risks

Flag is off by default, so no behaviour change until enabled. Progress events are not emitted yet.

Model Used

Claude Sonnet 5.5 (claude-sonnet-5-5)

Issue Link

Closes #21023

Changelog fragment

  • N/A (internal change; flag default off)

Checklist

Pre-handover (docs/developer/CLAUDE_REVIEW.md, #19285)

  • Every guard or test this body claims exists and ran
  • Size ceilings met by splitting, not by trimming text
  • Every cited owner decision is quoted on its issue
  • Pre-push green: it runs the whole-tree guards (symbol forks, isolated-git, file size, reach)

@mrveiss mrveiss added the phase:M4.9 One definition per concept label Nov 7, 2026
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2

  • main
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at b80b31f

Verdict: CHANGES NEEDED — the design meets #21023 and the tests pass, but two silent-degradation paths (Redis None, and tool statuses that never advance a step) need a fix or an explicit decision before merge. Reviewed against base issue-21024-agentloop-decision-ssot.

Severity file:line Finding Fix
Medium chat_workflow/plan_runner.py open_plan / tracker_from_state With manager.redis_client None, open_plan works because the planner caches the plan in its own _plans. tracker_from_state then builds a new planner per node, and with no Redis get_plan returns None. So advance raises, is caught, and the plan stops after step 1. The client already got agent.plan and then sees no progress. The failure is logged but not visible. Without Redis, treat it as no plan: have open_plan return None when redis_client is None and log once. A plan that cannot be tracked should not be announced.
Medium plan_runner.py advance (status in ("success","error")) Only success and error count. completed (delegate, tool_handler.py:2323), pending_delegation and schema_error are ignored, so a pass of only delegate calls or schema-invalid calls never advances or fails the step. The step stays current for the rest of the turn. Decide this explicitly: add completed to the success set and schema_error to the failed set (or add a test pinning that they are deliberately ignored).
Low graph_planner.py:33 (create_plan) state["llm_params"]["selected_model"], state["session_id"] and state["user_message"] are read outside the _create try block. A missing key raises in a graph node, and the turn fails on a flag-on path. Use .get and return {} when the model or message is missing.
Low plan_runner.py:_create / limits.py PLANNER_TIMEOUT_SECONDS The planner is a blocking LLM call before the first token of every flag-on turn, including trivial ones ("hi"). It is bounded at 30s by default. That is the worst-case added latency per turn. Prompt growth itself is fine: one short Guidance line per turn, and _carry_tool_results_into_prompt rebuilds the prompt so the block is not stacked. Document the latency cost in the ENV_VARS row, or skip planning for lightweight or no-tool turns.
Low graph.py:930 exec_history[len(state.get("execution_history", [])):] assumes dispatch_approved_calls returns the old history plus the new entries. plan_runner_21023_test and graph_planner_20846_test::test_complete_step_is_called_after_the_inline_tool_pass cover only the inline branch, so nothing pins the dispatched-branch slice. Add a test for the dispatch_approved_calls branch that checks the slice, using a history that already has entries.

AC evidence for #21023:

  • create_plan behind the flag, default off: graph_planner.create_plan returns {} when planner_enabled() is false. planner_enabled reads config.llm.chat_planner_enabled. Node is wired perform_knowledge_search -> create_plan -> generate_response. Test test_flag_off_calls_nothing.
  • Turn's model, provider registry: planner_client.PlannerLLMClient uses get_provider_registry() with the turn's selected_model. It uses ProviderType.OLLAMA, the same as llm_failover.py:98.
  • Step cap: steps_for_depth uses limits.MAX_CONTINUATION_ITERATIONS. planner.py now truncates steps to max_steps_per_plan in both loops. test_steps_are_capped_at_the_configured_maximum.
  • Timeout and failure: AUTOBOT_CHAT_PLANNER_TIMEOUT_SECONDS (default 30) is registered and in ENV_VARS. _create wraps wait_for and catches Exception, returning None, so the turn runs without a plan.
  • State: ChatState has plan_id, current_step_id, plan_progress. initialize_session spreads NO_PLAN. Test test_initialize_session_resets_plan_state.
  • Redis: the plan is stored under autobot:plans:<id>. Test test_plan_body_is_stored_in_redis_and_round_trips_metadata. See the Redis-None finding.
  • Advance: execute_tools advances after dispatch_approved_calls, and _inline_dispatched_update advances on the inline branch. Error fails the step and the plan stops (test_a_tool_error_fails_the_step_and_ends_the_plan). Statuses other than success or error (including pending_approval) change nothing. See the status finding for the gaps.
  • Fallback or under 2 steps is no plan: open_plan checks metadata["fallback"] and total_steps < MIN_PLAN_STEPS. planner.py marks both fallback paths. test_a_fallback_plan_is_no_plan.
  • One runner, depth policy: manager._run_llm_iterations uses open_for_ctx and plan.advance. cap//(depth+1) with 0 below 2 gives 5, 2, then none. Tests cover the legacy loop and the depth policy.
  • Event doctrine: the planner gets event_stream=None and emit_plan publishes the one existing agent.plan event. No second bus and no new event type.
  • Size refactors: graph_hooks.py and kb_sources.py are verbatim moves, re-imported by name into graph and manager. The ratchet entries went down (graph 1459 to 1443, manager 3766 to 3750).
  • Tests and controls: the flag-off test and the no-plan-keys test are controls. The prompt test includes a no-plan control. live_entry_uses_planner_20846_test drives the real build_chat_graph() on MemorySaver through process_message_stream, with a flag-off baseline. I ran the 6 test files: 57 passed.

Not checked: CI (many checks on this stack's runs fail; I did not read the logs). I did not run the wider chat_workflow suite, so patches of the moved symbols elsewhere in the test tree are unconfirmed beyond the by-name re-import. I did not test a real LLM or a live Redis outage. I did not check the interaction with #21022 stall escalation.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Pushed 121b1d0: review fixes

  • MEDIUM Redis None: open_plan returns None (no plan, no agent.plan announcement), logged once at info; test added
  • MEDIUM statuses: one STATUS_OUTCOME table in plan_runner (advance: success, completed, executed; fail: error, schema_error, ast_rejected, gated; wait: pending_approval, approval_required, pending_delegation). Parametrised test over every status, plus a source scan of the dispatch files so a new status cannot be left undecided
  • LOW create_plan: state reads moved inside the try; failure returns NO_PLAN
  • LOW latency: SSOT gate chat_planner_min_message_chars (AUTOBOT_CHAT_PLANNER_MIN_MESSAGE_CHARS, default 24); shorter turns skip the planner. Not gated on detect_intent: that node only handles exit and slash commands, so it says nothing about tool intent. Whether a smarter intent gate is wanted is an owner decision
  • LOW dispatch branch: test pins the history slice with a pre-existing error entry
    Merged the updated chore(agents): record chat-graph-canonical decision, move ask-human defaults to SSOT (#21024) #21058 branch (8fa0865), then origin/main.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 121b1d0

Verdict: APPROVE-READY — every CHANGES NEEDED finding is fixed in the delta b80b31f591..121b1d0c2e; two LOW notes on the status scanner.

Earlier finding Status Evidence
No Redis: plan attempted and announced Fixed open_plan returns None before building the planner when manager.redis_client is None, and calls _log_no_redis_once() (module flag, one info line per process). test_without_redis_there_is_no_plan_and_nothing_is_announced asserts a None return and zero emit_plan calls.
Tool-result statuses undecided Fixed plan_runner.STATUS_OUTCOME matches the requested table exactly: advance = success, completed, executed; fail = error, schema_error, ast_rejected, gated; wait = pending_approval, approval_required, pending_delegation. advance() only acts on ADVANCE or FAIL, and a FAIL in a pass fails the step.
Status table untested Fixed test_every_dispatch_status_has_its_decided_outcome is parametrised over all 10 statuses and checks the resulting step state, not just the table.
Scanner so new statuses cannot go undecided Present, see LOWs test_the_table_lists_every_status_the_dispatch_path_can_emit has a control assert that the scan found something.
create_plan state reads outside the try Fixed config["configurable"]["manager"], state["session_id"], state["user_message"] and state["llm_params"]["selected_model"] are now inside the try; on failure it logs with logger.exception and returns NO_PLAN. graph_planner_20846_test.py was extended for this.
Short turns cost a planner LLM call Fixed on every route AUTOBOT_CHAT_PLANNER_MIN_MESSAGE_CHARS (default 24) is read via config.llm.chat_planner_min_message_chars (ge=0), registered in env_registry_agent_tools.py and ENV_VARS.md. The gate is in worth_planning, called from open_plan, which the graph node, the legacy loop and delegation all use (open_for_ctx). test_a_short_turn_skips_the_planner_and_the_control_plans asserts 0 LLM calls for "hi" and 1 for the long control. Test messages were lengthened (_TASK) and the live-entry test was updated.
dispatch_approved_calls branch untested Fixed test_step_advance_slices_only_this_passs_entries_on_the_dispatch_branch patches graph.dispatch_approved_calls to return old and new entries and checks that only the new tail settles the step.

Test runs (temporary worktree at this head, since removed): plan_runner_21023_test, graph_planner_20846_test, live_entry_uses_planner_20846_test, planner/planner_test, chat_graph_settings_validation_21024_test, agent_loop_ported_to_chat_graph_20846_test and env_registry_is_extensible_test ran together: 50 passed. scripts/audit_api_wiring_test.py plus repo_tests/prepush_wiring_18808_test.py: 15 passed. The #21058 head (8fa0865) is an ancestor of this head and the merge adds no extra change relative to issue-21024-agentloop-decision-ssot, other than the intended planner work.

New findings:

  • LOW: the status scanner is somewhat brittle. It matches only dict literals of the form "status": "x", in a hard-coded list of 4 files. A status passed as status="x", held in a variable, or emitted from another dispatcher file would not be seen. It is also one-directional (it does not flag stale table entries) and special-cases discard("active"). It is a useful guard against the common drift but not a proof; widening the pattern to cover status= keyword use would make it sturdier.
  • LOW: a status that is not in the table is silently treated as WAIT in advance() (filtered out by STATUS_OUTCOME.get). That is a safe default, and the scanner is what keeps it from being hit.

Not checked: CI status; real Redis behaviour (the tests use an in-memory fake); the full backend suite.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 121b1d0

Verdict: APPROVE (code, delta over #21058 only). Merge gate: stacked on #21058, which must land first and the base retargeted to main; CI shows failing checks at this head (python-suite, autofix-types, the Jekyll Liquid-tag doc check, provision-packages and others), not diagnosed by me, and red CI does not merge.

Scope: 19 files in the delta, 0 behind main, 0 unresolved review threads.

# Severity Finding
1 Low planner_client.py hardcodes ProviderType.OLLAMA. It matches the route llm_failover.py uses, so it is consistent today, but a turn on a non-local provider would still plan through the local provider. Worth a follow-up if hosted providers are selectable for chat.
2 Low PlanTracker._refresh is async with no await; make it sync.
3 Low Module-level _NO_REDIS_LOGGED global for log-once; fine, but a functools.cached helper would avoid mutable module state.
4 Low Plan bodies are stored under autobot:plans:<id> with the user's task text; no TTL or session scoping was visible in this delta. Access is only by the plan id held in the turn's own state, so no cross-session path found; confirm the existing _store_plan TTL covers it.
5 Info Config: AUTOBOT_CHAT_PLANNER_TIMEOUT_SECONDS (env-backed in limits.py), AUTOBOT_CHAT_PLANNER_MIN_MESSAGE_CHARS (SSOT) are registered and in ENV_VARS. Off by default: create_plan returns {} at once.
6 Info Duplication: graph and legacy loop share plan_runner (one create/advance implementation); STATUS_OUTCOME is one table with a guard test. File ceilings lowered to actual (graph.py 1443, manager.py 3750); planner.py unchanged at 877. No function over 30 lines in new code; no fixed sleeps in new tests; tests assert on spies and include a flag-off control.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Review fixes pushed at 7d51d01 (the updated #21058 branch and main are merged in first).

Finding Fix Where
(a) planner hardcodes ProviderType.OLLAMA The failover module hardcoded it too (two sites), so both now share one resolver, configured_provider(), which reads config.llm.provider (AUTOBOT_LLM_PROVIDER). No other open PR touches the failover module. new autobot-backend/chat_workflow/llm_provider.py:18; used in planner_client.py (request build) and llm_failover.py (_build_request, _primary_is_held)
(b) PlanTracker._refresh async with no await Made synchronous; its one caller updated. autobot-backend/chat_workflow/plan_runner.py:130, caller :146
(c) module-level _NO_REDIS_LOGGED No shared public log-once helper exists: only private per-module _warn_once copies (deployment profile, redis endpoint, findings verify). Kept the flag, now documented as an explicit per-process flag set only by _log_no_redis_once. The three private copies are a separate consolidation candidate. plan_runner.py (comment above _NO_REDIS_LOGGED)
(d) plan TTL, registry, scoping The TTL was a literal 24h default on PlannerConfig, not env-backed. It is now PLAN_TTL_SECONDS from AUTOBOT_PLAN_TTL_SECONDS, registered and in ENV_VARS. Keys were autobot:plans:<id>, not session-scoped; the chat planner now uses autobot:plans:<session>:<id> (empty scope keeps the legacy key). planner.py stays at its 877-line ceiling; the logic lives in a new module. autobot-backend/planner/plan_storage.py:15,19, planner/planner.py (key_scope, key sites), plan_runner.py (_build_planner), autobot_shared/env_registry_agent_tools.py (end of file)

Tests, all in autobot-backend/chat_workflow/plan_storage_21023_test.py: test_plan_key_is_session_scoped_and_carries_the_env_backed_ttl (key and TTL passed to set; another session reads None), test_unscoped_planner_keeps_the_legacy_key, test_ttl_is_an_env_backed_registered_constant, test_refresh_is_synchronous, test_provider_comes_from_config, test_planner_client_and_failover_use_the_configured_provider. Run together with the plan-runner, planner, failover, unconnected-code-gate, env-registry and bare-cast tests: 116 passed.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 7d51d01

Verdict: CHANGES. Stacked on #21058. Fix commit 7d51d01 touches 9 files; the PR shows 113 changed files against its stacked base. 0 behind main, merge state DIRTY (needs the stack base retargeted/synced), 0 review threads.

# Severity Finding Verdict
1 Medium configured_provider() (chat_workflow/llm_provider.py) raises ValueError on an unknown AUTOBOT_LLM_PROVIDER. config.llm.provider is a plain str, so nothing rejects it at startup, and nothing logs it. The failover call in _primary_is_held runs before the stream try/except in stream_with_failover, so a typo now fails every chat iteration, where it used to be harmless. No test covers the invalid value. Fix: validate at config load (or catch and fall back to ollama with a one-time warning) and add a test. CHANGES
2 Low Default is unchanged: unset resolves to "ollama" (ssot_config.py field default), so the failover request and degradation key are identical to the old hardcoded ProviderType.OLLAMA for an install that does not set it. An install that already sets AUTOBOT_LLM_PROVIDER to another provider now gets failover and planner requests for that provider with the turn's model name. This is the intent, but say so in the PR body. Note
3 Info _refresh is sync and has a single caller (plan_runner.py, updated); no other PlanTracker._refresh caller exists. Test pins non-coroutine. OK
4 Medium The log-once claim is inaccurate. There are five private _warn_once copies, not three: llc/services/findings_verify.py, autobot_shared/deployment_profile.py, autobot_shared/redis_management/endpoint.py, plus two in the SLM backend (services/ssh_utils.py, user_management/config.py). No consolidation issue is referenced in the code, the PR body or a comment, and a search of open and closed issues finds none. Fix: file it (listing all five plus _NO_REDIS_LOGGED), link it from the comment above the flag, and correct the count. CHANGES
5 Info TTL: AUTOBOT_PLAN_TTL_SECONDS is env-backed via env_int, registered in env_registry_agent_tools.py and documented in ENV_VARS.md with a matching default. OK
6 Low Plan keys: the only production constructor of LLMPlannerModule is plan_runner._build_planner, which passes key_scope=session_id. No unscoped production caller exists today; the legacy key is reachable only by tests or by an empty session id. Cross-session read is therefore not possible now. Suggest rejecting an empty scope in _build_planner, so a future unscoped caller cannot reintroduce it. Advisory
7 Info No sleeps, no line-number comments. New functions are under 30 lines. planner.py is 877 lines and registered in the size baseline at 877; llm_failover.py 210, plan_runner.py 244. OK

…anner rejects empty key_scope, no-redis flag links #21071 (#21023)
@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Findings fixed at 555f604 (the #21058 branch merged in without conflicts; main already contained).

Finding Fix Where
1 MEDIUM invalid AUTOBOT_LLM_PROVIDER fails every chat Validator on the provider field at config load: unknown value falls back to ollama with one warning naming the allowed values. Fallback rather than fail-fast, because config.llm.provider is also read by agent schemas and per-agent routing, so a hard failure could stop an existing install that never used the chat registry. autobot_shared/ssot_chat_graph_settings.py:55 (_provider_is_known); tests plan_storage_21023_test.py:99 (fallback, one warning, allowed list) and :114 (known value kept)
2 LOW provider behaviour change Line added to the PR body. PR body
4 MEDIUM log-once copies Comment links #21071 (5 private _warn_once copies + module flags); body corrected. autobot-backend/chat_workflow/plan_runner.py:65-68
6 LOW unscoped planner LLMPlannerModule.__init__ calls require_scoped; plan_key also rejects an empty scope. Only other callers were tests; planner_test.py now passes key_scope. planner/plan_storage.py:20,27, planner/planner.py init; test plan_storage_21023_test.py:56 (test_unscoped_planner_is_rejected)

Tests: plan_storage, plan_runner, graph_planner, live_entry, planner, llm_failover, ssot_config, chat_graph_settings_validation, unconnected_code_gate and env registry: 157 passed before the last refactor; plan_storage and planner re-run after: 16 passed.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at 555f604

Verdict: CHANGES (three small items, all in files this PR already touches; the four requested fixes themselves verify).

# Item Verdict Evidence
1 Invalid AUTOBOT_LLM_PROVIDER falls back to ollama at config load, one warning naming allowed values OK ssot_chat_graph_settings.py _provider_is_known (mode=before, check_fields=False), inherited by LLMConfig(RedactedSettings, ChatGraphSettings), whose provider field has the alias. Allowed set is status_enums.LLMProvider. Warning gated by module flag _PROVIDER_WARNED, so once per process, not per access. " OpenAI " normalises to openai. Test builds two configs with "olama" and asserts one warning containing allowed: plus ollama.
1a Tests cover invalid, valid, unset CHANGES (minor) Invalid and valid are covered in plan_storage_21023_test.py. Unset is not: no test shows the default stays ollama with no warning. Add LLMConfig() with the env var absent, then assert no warning and provider == "ollama".
1b Logger CHANGES (minor) The module uses stdlib logging.getLogger; the repo pattern is get_logger(__name__) from autobot_shared.logging_manager. Use it, or note in a comment why a cycle forbids it.
2 PR body notes the behaviour change OK The Provider bullet says failover and planner now follow AUTOBOT_LLM_PROVIDER where they were hardcoded to Ollama, and that an unknown value falls back with a warning.
4 #21071 linked at the flag site and in the body OK plan_runner.py comment on _NO_REDIS_LOGGED ends "Consolidation into one shared helper: #21071"; the body repeats it.
6 Empty key_scope rejected OK plan_key and require_scoped raise ValueError; LLMPlannerModule.__init__ calls require_scoped(config or PlannerConfig()). Test covers both a bare config and no config. The only production constructor (plan_runner._build_planner) passes session_id.
6a Legacy unscoped key fully gone, no reader left CHANGES (minor) No code reads or writes autobot:plans:<id> at head (the planner read and write sites at planner.py use plan_key; main still has the literals). Two stale statements remain: plan_storage.py module docstring line 8 still says "an empty scope keeps the legacy unscoped key autobot:plans:<id>", which is now false; docs/design/PLANNER_MODULE_DESIGN.md lines 704 and 713 show the unscoped key. Fix both here.
7 planner_test key assertion OK Now autobot:plans:s1:<id> with key_scope="s1" in the _planner helper.
8 No fixed sleeps, no line-number comments OK Grep of both test files finds none.
9 Size limits OK Largest touched files: planner.py 877 lines, which is over 600, so it must already be in the known-large ceiling list. This commit changes it by 2 lines and does not grow it. All others are under 600. New functions (plan_key, require_scoped, _provider_is_known) are 10 lines or fewer; _provider_is_known is about 20.
10 Behind count CHANGES (info) 47 commits behind origin/main. The PR is stacked on #21024 (merge state UNSTABLE), so sync once the base lands or retarget; do not CI a stale head.
11 Unresolved review threads OK 0 unresolved threads on the PR (GraphQL isResolved=false returned none).

Fix 1a, 1b and 6a in this PR; none needs a separate issue.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Landed on main via merge train #21093 (merge commit b83a986); every commit of head 555f604 is in main.

@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Branch deleted after verification: every commit is in main and the branch shows 0 changed files against main. Restore it from this PR if needed.

timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M4.9 One definition per concept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant