~20 min read

Agent Mode Guide

Everything about the Thumper-Run AI agent: tools, templates, configuration, and best practices.

Overview

The agent uses the ReAct (Reason + Act) framework to solve tasks step by step:

  1. Your message enters the conversation
  2. The LLM reasons about what to do (Thought:)
  3. It selects a tool and provides JSON arguments (Action: + Action Input:)
  4. Permission check — safe tools auto-run, others need approval
  5. Tool executes with a timeout
  6. Result returned as Observation — loop repeats or agent gives Final Answer

Fully local by default. Conversations never leave your device unless you choose a cloud API backend.

All 32 Tools

Filesystem Tools (8)

ToolSafetyTimeoutKey Parameters
file_readSafe10spath, offset, limit
file_writeConfirm10spath, content
file_editConfirm10spath, old_string (exact match), new_string
list_filesSafe30spath, recursive
search_filesSafe30spattern, path
search_codeSafe30spattern, path, regex
run_commandConfirm60scommand, working_dir
web_searchSafe30squery

Launcher Tools (6)

ToolSafetyTimeoutKey Parameters
list_appsSafe10squery, tag, runtime
app_statusSafevariesapp_id
install_appConfirm300ssource_url (git URL), app_id, branch
launch_appConfirm120sapp_id, port (1024-65535), env
stop_appConfirm60sapp_id, force (SIGKILL vs SIGTERM), timeout_secs
app_logsSafe30sapp_id, lines, offset, level, search

GPU & Manifest Diagnostic Tools (7)

ToolSafetyTimeoutDescription
gpu_diagnoseSafe30sDetect GPU vendor, model, VRAM, driver version
gpu_test_pytorchSafe60sTest torch.cuda / torch.hip availability in app venv
manifest_validateSafe10sValidate .thumper.yaml against schema
manifest_generateSafe30sGenerate manifest from repo structure
manifest_fixSafe30sAuto-fix common manifest issues
install_debugSafe60sDebug installation failures (venv, deps, paths)
model_manageSafe30sModel file management (list, verify, info)

Model Intelligence Tools (5)

ToolSafetyTimeoutDescription
model_listSafe30sList models by location, filter, with stats
model_infoSafe10sGet detailed info about a specific model
model_downloadConfirm300sDownload from HF repo (repo_id, filename, revision)
workflow_analyzeSafe30sParse ComfyUI workflow, detect 17+ loader node types
hardware_statusSafe10sVRAM, RAM, disk space, CPU info

Model Manifest v2 Tools (3)

ToolSafetyTimeoutDescription
model_manifest_validateSafe10sValidate .model.yaml/.pack.yaml against v2 schema
model_manifest_generateSafe30sGenerate manifest from HF repo ID or local file
model_cache_diagnoseSafe30sDisk usage, entry counts, duplicate detection

Log & Diagnostic Tools (3)

ToolSafetyTimeoutDescription
crash_log_debugSafe30sAnalyze crash logs for root cause patterns
app_manifest_debugSafe10sValidate manifest fields and cross-references
app_diagnoseSafe60sComposite: process + crashes + manifest + logs

You don't need to memorize tool names. Describe what you want and the agent picks the right tools.

Templates

TemplateSystem Prompt AdditionBest For
(default)Platform knowledge + all toolsApp management, debugging, exploration
code-helper"Focus on code-related tasks. Prefer search_code, file_read, file_edit. Show code snippets."Editing configs, writing scripts, vibe coding
research-agent"Focus on research. Use search_files, search_code, file_read. Summarize with bullet points."Exploring codebases, reading logs, comparing files

Your last-used template is persisted via CRDT at /user/agents/launch_preferences.

Model Selection

BackendProtocolSetupOfflineCost
LlamaCppNative C++ FFILoad .gguf from diskYesFree
OllamaREST localhost:11434Auto-managed by ThumperYesFree
OpenAI CompatibleREST APIAPI key + endpoint URLNoPer token
AnthropicREST APIAPI keyNoPer token
Docker vLLMREST to containerDocker setupYesFree

Recommended Models by Task

TaskModelSizeWhy
Quick edits, YAML/JSONqwen3:4b2.4 GBFast, low VRAM, good for structured data
Python code, debuggingcodellama:7b4 GBCode-specialized, good reasoning
General tasksllama3.1:8b4.7 GBBalanced speed and quality
Complex multi-filellama3.1:70b40 GBHighest quality reasoning

Model selection is persisted via CRDT at /user/agents/launch_preferences.

Context & Memory

The agent uses a sliding window memory with these defaults:

  • Max context messages: 50
  • Summary threshold: 30 messages (triggers summarization)
  • Keep recent: 6 messages (always preserved)
  • Context size: 4096 tokens
  • Output reserved: 1024 tokens

Compaction

At 90 messages, you'll see a compaction warning. At 128, the conversation auto-compacts — older messages are summarized to free space. A "Roll Back" button appears if you want to undo compaction.

File Attachments

At launch, you can attach files to give the agent initial context: image/*, .pdf, .txt, .md, .json, .csv.

External Knowledge File

Create ~/.local/share/tr-desktop/agent_knowledge.md (max ~2000 chars) to inject persistent context into every session. Loaded at priority 3.

Long tool outputs consume context fast. Use file_read with offset/limit for large files. A 1000-line file read uses ~3000 tokens of your 4096 budget.

Approval Workflow

Three Safety Tiers

LevelCountBehaviorTools
Safe25Auto-run, no approvalAll read-only and diagnostic tools
Confirm7Permission modal before executioninstall_app, launch_app, stop_app, file_write, file_edit, run_command, model_download
Dangerous-Extra caution flaggedrun_command with rm, kill, chmod

Permission Modal

The modal shows: tool name, full arguments as JSON, risk description, and Approve/Deny buttons.

What Happens on Denial

The agent sees "User denied execution" as a ToolResult. It continues reasoning and may try an alternative approach or ask for guidance.

What to Check

ToolVerify
file_write / file_editFile path and content changes
run_commandFull command — watch for rm, kill, curl to unknown URLs, pip install from untrusted sources
install_appsource_url (is it a trusted repo?) and branch
launch_app / stop_appapp_id, port, env variables, force flag
model_downloadrepo_id, disk space available

Error Recovery

When a tool fails, the agent sees the error and can retry with different parameters. The executor has step_with_retry for malformed output. Per-tool timeouts: file ops=10s, search=30s, run_command=60s, install_app=300s.

Never approve run_command without reading it. Watch for: rm, kill, chmod, curl to unknown URLs, pip install from untrusted sources.

Session Management

Sessions are stored in two CRDT documents:

  • Device (/device/agents/running/{session_id}) — local only: session_id, status, current_task, is_paused, last_activity
  • User (/user/agents/sessions/{session_id}) — user-scoped session state; current sync is server-assisted

Session status flow: Initializing → Ready → Thinking → Paused → Completed/Error

Maximum 10 concurrent sessions. IPC commands: agent_new_session, agent_get_history, agent_list_tools.

Supported sessions can sync across paired devices through the current server-assisted CRDT path. Private E2EE remains planned.

Privacy & Boundaries

What the Agent Can Access

Files within ~/.local/share/tr-desktop/ (apps directory, models directory, agent_knowledge.md). The ToolContext has sandboxed: true and working_directory scoped to the project root.

What Leaves Your Device

Nothing with Ollama, LlamaCpp, or Docker vLLM. With cloud API backends (OpenAI Compatible, Anthropic): conversation text is sent to the API provider. Tool results stay local.

What the Agent CAN'T Do

  • Cannot install system packages (apt, brew, pacman)
  • Cannot modify files outside app directories
  • Cannot train or fine-tune models
  • Cannot access network services beyond API calls
  • Cannot execute arbitrary Python outside run_command
  • Cannot manage multiple devices simultaneously
  • Cannot access API keys or secrets stored in the system
  • Cannot make purchases or financial transactions

The platform prompt tells the agent: "You are the AI assistant embedded in Thumper-Run." It knows about apps, launcher, model hub, and its tool set — nothing more.

Configuration

SettingDefaultRangeDescription
temperature0.70.0 - 2.0LLM creativity/randomness
max_iterations251 - 100Max ReAct loop iterations per request
tools_enabledall-Tool whitelist (empty = all)
preferred_backendOllama-Default LLM backend
system_prompt(built-in)-Custom system prompt override (priority 9)

Tips & Anti-Patterns

Do

  1. Be specific about file paths — saves a search_files call (~200 tokens)
  2. Use code-helper template for editing tasks
  3. Attach reference files at launch for context
  4. Ask "what would you change?" before "change it" — discuss before executing
  5. Use "search then edit" for bulk changes across files
  6. Read tool arguments before approving
  7. Check diff view for file edits
  8. Create agent_knowledge.md for persistent project context

Don't (Anti-Patterns)

  1. Don't ask the agent to read entire large files — use offset/limit or ask for specific sections
  2. Don't chain 10 requests in one message — work step by step
  3. Don't approve run_command without reading the full command
  4. Don't expect the agent to remember previous sessions — each starts fresh (but can restore)
  5. Don't use cloud APIs for sensitive code — use local Ollama/LlamaCpp instead