Goal Management
Goals transform Myrm from a chat assistant into an autonomous worker. Define an objective, set constraints, and let the agent work independently across multiple turns.Creating a Goal
From the GUI
- Toggle Goal Mode in the message input area (bottom-right toggle button)
- The configuration panel expands with sections:
- Budget — Set any combination of
max_tokens,max_usd,max_time_seconds, andmax_turns - Acceptance Criteria — Define shell commands and semantic checks the agent must pass
- Constraints — Rules the agent must follow during execution
- Protected Paths — Glob patterns for files the agent must not modify (e.g.,
*.env,migrations/**) - Advanced —
loop_on_pause,convergence_window, Pause after each step (per-todo checkpoint)
- Budget — Set any combination of
- Type your objective in the message box and send — the agent begins planning and executing
From Chat
Simply describe a complex task in natural language. The agent will detect it requires sustained effort and offer to create a goal.Goal Lifecycle
Budget Control
Every goal has 4 budget dimensions:
Budget exhaustion pauses the goal with a structured summary of progress. You can resume the goal with additional budget at any time.
Acceptance Criteria
Define what “done” looks like:- Shell verification — Runs test commands (e.g.,
pytest,npm test) and checks results - Semantic verification — LLM-based assessment against your acceptance criteria
Advanced: Logical Consistency Verification
For long document tasks, semantic verification ensures the entire output is logically consistent:Constraints
Hard rules the agent must follow:14-Layer Dead-Loop Shield
At the end of every turn, a 14-layer guard chain determines whether the agent should continue — preventing runaway execution, cost overruns, token waste, goal drift, and sandbox probing:
Additionally, progressive budget degradation (WARNING → FINALIZATION) with dynamic remaining USD injection and 4-layer context-window overflow protection operate at the middleware level to catch edge cases before they reach the guard chain.
Judge Feedback Loop
When the semantic judge determines the goal is not yet complete, it provides a specific reason (e.g., “only 3 of 5 charts produced”). This reason is automatically injected into the next turn’s prompt so the agent knows exactly what gap to address — eliminating redundant re-analysis and reducing unnecessary turns.Per-Todo Checkpoint
Enable “Pause after each step” in Advanced settings to activate per-todo checkpoint mode. When enabled, the agent automatically pauses after completing each todo item and waits for your confirmation before continuing. How it works:- Agent reports a todo item as completed via
todo_write - Guard chain detects the new completion and pauses the goal
- GoalStatusCard shows which step(s) just finished with a Continue button
- You review the results, then click Continue to proceed to the next step
- Production deployments — Confirm each migration step before proceeding
- Data pipelines — Verify data integrity at each stage
- Complex refactors — Review code changes step by step
- Learning — Understand what the agent does at each stage
Kanban Goal Mode
Goals are not limited to chat — you can enable Goal Mode on any Kanban task card for autonomous multi-turn execution:Enabling Goal Mode
- When creating a new Kanban task, toggle Goal Mode in the task creation form
- Optionally set Max Turns (defaults to the system goal budget if not specified)
- The task description becomes the goal objective; the agent works toward it across multiple turns
How It Works
When a Goal Mode task is dispatched:- The
KanbanTaskRunnercreates aGoalProvidervia theGoalRegistry, reusing the full Goal engine (same infrastructure as chat goals) - The
StreamExecutordrives the autonomous loop — semantic judge, 14-layer guard chain, budget control, convergence detection — all apply - On completion:
GoalStatus.COMPLETE→ task markedCOMPLETED; budget exhaustion → task markedFAILEDwith structured summary
Why Use It
Visual Indicators
- Task Card — A “Goal Mode” badge appears on cards with goal mode enabled (shows max turns if set)
- Task Drawer — The details section shows Goal Mode status
Budget & Safety
All 4 budget dimensions (tokens, USD, time, turns) apply. The 14-layer dead-loop shield runs on every turn, preventing runaway execution, cost overruns, and goal drift — identical protections to chat goals.Priority Queue
When you create multiple goals, they’re automatically queued:- The first goal runs immediately
- Subsequent goals enter
QUEUEDstate - When the active goal finishes, the next queued goal auto-starts
- Drag-and-drop reordering in the GUI
auto_approve: true to skip the approval step for queued goals, enabling fully unattended execution of goal chains.
Saved Agent Profile on Continuation
When a goal auto-continues (queue dequeue, background WAIT resume, or loop restart), Myrm does not fall back to a generic headless agent. The continuation path loads the chat-bound Saved Agent profile and injects the same runtime context as your first turn:
This means long-running goals keep formal tone (e.g., Korean 합니다体 via
builtin-ko-office or a custom response_locale_policy), team roster text, and tool scope across every unattended turn — not just turn 1.
Implementation entry point: goal_stream_trigger.py (trigger_goal_stream / _resolve_goal_stream_agent_context).
Verified (Aug 2026): Goal Chrome E2E (test_goal_focus_chrome_e2e.py) passed 2/2 live runs (~3 min pytest body each) via real WebUI + MCP mux + MiniMax-M3 — confirms Goal mode stream, wait_turn_done, and persisted goal status on a private SHPOIB backend.
Adaptive Convergence & Loop-on-Pause
Goals can automatically detect when the agent has finished its work and handle continuous execution without human intervention.Convergence Detection
When the agent goesconvergence_window consecutive turns without making any tool calls, the goal is automatically marked as converged (completed). This prevents the agent from idling and wasting tokens when it has nothing left to do.
Loop-on-Pause
When enabled, a goal that pauses due to convergence will automatically restart with a fresh context, up to a configurable maximum number of restarts. This is ideal for long-running monitoring or iterative refinement tasks.Resume Safety
When you manually resume a paused goal, all runtime counters (no_progress_streak, loop_restarts, consecutive_judge_parse_failures) are automatically reset to zero. This ensures the agent gets a fresh opportunity without triggering immediate re-convergence or false auto-pauses.
Judge Failure Circuit Breaker
If the semantic judge model returns unparseable output (not valid JSON) 3 consecutive times, the goal is automatically paused to prevent burning tokens on a misconfigured judge. This protects against:- Using a weak model that can’t follow the JSON reply contract
- Temporary model degradation producing garbage output
- Token budget waste from infinite retry loops
Server Restart Recovery
If the server restarts (upgrade, crash, or container reschedule) while a goal is active, the orphaned goal is automatically detected and paused with a clear reason:- On startup, the server scans for goals still marked ACTIVE with no execution engine driving them
- Each orphaned goal transitions to PAUSED with the reason “Server restarted — resume when ready”
- A system notification alerts you that goals were paused
- Open the affected chat to see the paused status and one-click Resume when ready
Frontend Status
The Goal Status Card displays differentiated states:- Converged — Goal completed via convergence detection
- Restarting (#N) — Goal is restarting via loop-on-pause (showing restart count)
Global Goal Tracking
Monitor all active goals from any page without switching contexts:- NavBar Badge — A real-time badge shows the number of active goals. Updates instantly via Server-Sent Events when a goal completes or dequeues.
- Background Tasks Popover — Click the badge to see all active goals across all sessions: objective, status, tokens consumed, and elapsed time.
- Quick Actions — Pause, resume, or cancel any goal directly from the popover. A toast confirms the action.
- Navigate — “Go to session” button jumps directly to the goal’s chat for full detail.
- OS Notifications — When a goal finishes (completes, fails, or gets paused), you receive a system notification even if the browser tab is in the background.
Dynamic Subgoals
During execution, you can add new objectives without interrupting the agent:- Open the active goal’s detail panel
- Add a subgoal (e.g., “Also add unit tests for the new module”)
- The subgoal is injected into the agent’s context with highest priority
IM Slash Commands
Manage goals entirely from any IM channel (Slack, Feishu, Telegram, WhatsApp, etc.):
Constraints added via IM are injected into the agent’s prompt as “CONSTRAINTS (MUST NOT VIOLATE)” and enforced by the semantic judge during completion verification — identical behavior to GUI-defined constraints.
Objective Hot-Edit
Change the goal’s direction mid-execution:- Open the active goal’s detail panel
- Edit the objective text
- The change is injected as a steering message — the agent adjusts course without losing progress
Execution Summary
After completion, every goal produces aGoalExecutionSummary with:
- Files modified (with diff links)
- Token usage breakdown
- Cost breakdown by model
- Time elapsed
- Turn count
- Completion reason
IM Completion Notification
When a Goal is initiated from an IM channel (via/goal set), the completion result is automatically pushed back to the original conversation thread — no polling required.
Example
Start a Goal in Feishu:Deliverable Bundle
When a goal completes and has produced 2 or more artifacts (documents, spreadsheets, presentations, etc.), Myrm automatically aggregates them into a Deliverable Bundle card:- Auto-Collection — All artifacts generated during the goal’s session are collected without any manual action
- One-Click ZIP Download — Download the entire bundle as a single ZIP archive
- Per-File Preview — Click any individual deliverable to open it in the Artifact Portal with format-aware rendering
- Filename Deduplication — If multiple artifacts share the same name, unique identifiers are appended automatically
Clickable deliverable paths in chat
Beyond the Bundle card, when the agent cites deliverables with inline code in its reply, the WebUI renders them as clickable links:`workspace/reports/brief.md`— workspace-relative path; one tap opens Artifact Portal preview`@file_001`— harness short file ID (same alias the agent uses internally); clickable once the artifact SSE syncs
[Title](artifact:path) markdown plus a separate Right Rail; Myrm reuses the existing Portal — click the path in chat.
Note: the frozendeliverable_disciplineprompt block teaches agents to write files and cite paths; file creation auto-registers artifacts and SSE may includeshort_file_id.
Use Case: Full-Chain Office Delivery
Use the pre-built “Office Full-Chain Delivery” agent template to generate complete document suites in one conversation:- Select the “Office Full-Chain Delivery” agent from the agent selector
- Describe your deliverables (e.g., “Prepare quarterly report: Excel data + PPT presentation + Word summary”)
- The agent executes with Goal mode, maintaining data consistency across all documents
- On completion, the Deliverable Bundle card appears with all files ready for download
API Access
Deliverables are also available via REST API:GET /api/goals/{goal_id}/status— Returnsdeliverablesarray with artifact IDs and filenamesPOST /api/files/download-bundle— Downloads multiple artifacts as a ZIP archive
Example Workflow
Project Milestones (Cross-Session Goals)
While Goals operate within a single session, Project Milestones span across sessions. They let you define strategic objectives for an entire project, and the agent automatically stays aware of them in every conversation.How It Works
- Create milestones in the sidebar panel (within a Project)
- Agent auto-injects —
ProjectRoadmapMiddlewareinjects a compact roadmap context (~100 tokens) into every conversation in that project - Track progress — Milestones link to Kanban boards for automatic progress calculation
Creating Milestones
In the sidebar, navigate to your project and find the Milestones section:- Click the
+button to add a new milestone - Each milestone has a title, optional description, and acceptance criteria
- Double-click a milestone title to rename it inline
- Mark milestones as completed when objectives are met
Real-Time Progress Visualization
Each milestone displays a compact progress bar showing the completion rate of linked Kanban tasks:- A 3px progress bar appears below the title when the milestone has associated tasks
- Task count is shown (e.g., “6/8”) — no manual calculation needed
- Progress updates automatically when tasks are completed
- The
batch-progressAPI fetches all active milestone completion rates in a single request (no N+1 queries)
Automatic Context Injection
When you chat within a project that has milestones, the agent receives context like:Assessment Import (One-Click Report → Tasks)
When your agent produces assessment reports or review documents (as artifacts), you can convert them into milestones and tasks in one click:- Expand the Milestone panel in the sidebar
- Recent candidates appear automatically — the system probes each artifact to verify it contains importable tasks (semantic validation using the same parser as the import engine). Already-imported artifacts are automatically detected via the import ledger and shown as disabled.
- Click a candidate to import, or type an artifact ID manually
- Instant feedback — success shows a receipt (milestones + tasks created); failure shows a clear reason (e.g., “already imported”, “no actionable tasks”)
- Idempotent — the same artifact version cannot be imported twice into the same project (immutable ledger)
- Atomic — if import fails midway, all partially-created milestones/tasks are rolled back
- Observable — import funnel metrics (attempts, successes, failures by reason and trigger) are tracked for product analytics
- Value closure — the panel shows post-import task completion rate, so you can see the real impact of imported work