Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-3368Done

The re-plan pass advertises log_planning_mistake / log_planning_bug but replan.ts wires NEITHER — every call fails 'unavailable in this run'

Found while running story MOTIR-3322 (verified on origin/main @ e372f17).

replan.ts's GenerationSink implements neither logPlanningMistake nor logPlanningBug — while runGenerationPass advertises both tools on the re-plan pass.

  • SKELETON_PHASE_TOOLS and DEEPEN_PHASE_TOOLS (src/llm/treeGeneration.ts) both list log_planning_mistake and log_planning_bug, and every handler goes through runGenerationPass, so the re-plan pass offers them.
  • src/jobs/handlers/replan.tsgrep -an "logPlanningMistake\|logPlanningBug" returns nothing. Same for augment.ts and expandItem.ts. Only generateTree.ts wires either.
  • So the executor's if (!sink.logPlanningMistake) arm fires and the model gets lesson capture is unavailable in this run / planning-bug filing is unavailable in this run.

Why this matters more than a dead tool call. The log_planning_bug footer literally reads "Filed by the Motir planner during a re-plan", and MOTIR-3322's premise is that the re-plan path is where the commonest recurrence signal arrives. It arrives nowhere: the re-plan pass — the one operation named after this loop — cannot file a bug or capture a lesson at all. MOTIR-3326's search-before-file and MOTIR-3323's global revival are therefore live only on the onboarding / generate_tree path.

Not masked by MOTIR-3324, and not caused by it. That card withholds both tools when the envelope does not attribute the re-plan to an agent finding a card wrong. An agent-fired re-plan still advertises them — and still hits the absent sink. The two are independent: 3324 decides may this run capture, this bug is can it, at all.

Acceptance criteria

  • replan.ts's sink implements logPlanningMistake and logPlanningBug, wired to lessonService.captureMistake / lessonService.filePlanningBug exactly as generateTree.ts's sink does — including the scope: 'tenant' pin (MOTIR-3327) and the aiProjectId + mistakeType search context (MOTIR-3326), so the library is searched rather than the check recorded as unattempted.
  • The mistakeType the re-plan sink supplies is the phase assemblePlannerInputs resolved for the replan operation, not a literal.
  • An agent-fired re-plan that calls either tool reaches the store, asserted against a real database.
  • augment and expand_item are decided EXPLICITLY in the same change — wired the same way, or stated on the record why a plan-edit turn may not capture. Silence is what produced this defect.
  • A tool advertised on a pass whose sink cannot serve it is the general shape; state whether the surface should be derived from the sink rather than listed independently, or why listing them separately is right.

Context refs

  • motir-ai src/jobs/handlers/replan.ts — the sink, today implementing neither.
  • motir-ai src/jobs/handlers/generateTree.ts — the only sink that wires both; the shape to mirror.
  • motir-ai src/llm/treeGeneration.tsSKELETON_PHASE_TOOLS / DEEPEN_PHASE_TOOLS, logMistakeExecutor, logBugExecutor.