GoDotter: Full Architecture Breakdown
This is an English summary of the GoDotter architecture document. GoDotter (GitHub repo) is an AI-native editor plugin for Godot 4.3+ — described by its author as a "Godot version of Cursor."
Key points
- Two-layer architecture: a Godot
EditorPlugin(GDScript) plus a local Python FastAPI backend, launched by the plugin viaOS.create_process(default127.0.0.1:8765, scanning up to 64 ports if occupied). - Single-folder distribution: copying
addons/GoDotter/into any Godot project installs the full product, backend included. MIT-licensed, v0.2.0. - AI providers: Google Gemini primary; settings also support OpenAI, Claude, and OpenAI-compatible endpoints. Only LLM API calls leave the machine — project files stay local.
- Core workflow: plan first → show diff → execute on approval.
EditorBridgebuilds a context bundle (current scene, selected nodes, open scripts, project root);AgentClientPOSTs it to the backend; the backend combines project index, memory files, and token budgeting into prompts and returns a structured JSONPlan. GoDotter.gd— EditorPlugin entry: mounts the Forge Dock, spawns the backend process, captures editor logs and signals.ForgeState.gd— settings split into machine-level (godotter/machine/) and project-level (godotter/project/) keys inEditorSettings. Defaults are safe:enable_file_edits = false,approval_mode = "review".ForgeDock.gd— main UI with tabs: Chat (multi-session, image attachments, thinking traces), Plan, Inspect, Diff, Memory, Settings.- Supporting modules:
AgentClient,DiffManager,TaskQueue,SafetyManager,DebugVisualizer(Neon Visual Map),ScreenshotCapture,LogCollector,MemoryIndex,SetupWizard, and schema/prompt references inagents/. - Stack: FastAPI + uvicorn, google-genai, httpx, Pydantic v2, Pillow, python-dotenv.
- Key modules:
app.py(FastAPI app),task_orchestrator.py(Architect planning / execution),agent_run.py(plan → validate → execute loop),project_indexer.py,context_engine.py,gemini_client.py,code_tools.py,safety.py,visual_map.py,asset3d_review.py,memory_store.py,token_policy.py. - REST surface (selected):
POST /agent/plan,POST /agent/execute,POST /agent/run,POST /project/index,POST /project/context,POST /agent/visual_map,POST /agent/fix_from_logs,POST /tools/read_file|write_file|revert_file,GET /tools/git_status,GET /memory,GET /health. - The Plan JSON schema includes
summary,relevant_files/relevant_scenes(must come from the index — no invented paths),assumptions,risks,steps,validation_plan, andapproval_required. ClientAgentSchemas.gdmirrors backend Pydantic schemas. - Neon Visual Map: colorize the scene tree by node type, screenshot the editor viewport, and send image + node spatial mapping to the LLM for layout analysis.
- Fix from logs: live log capture (
GoDotterEditorLogger+ debugger hook →LogCollector) feeds/agent/fix_from_logsfor batch fix plans. - Project memory: Markdown notes under
.godot_forge/memory/(gitignored) injected into planning context. - Chat images: files, drag-drop, or clipboard, sent as Base64 into plan/execute/run calls.
- GDScript:
godot --headless --path <repo> --check-only - Python tests:
cd addons/GoDotter/backend && python -m unittest discover -s tests -v - Plan integration test requires
GEMINI_API_KEY(skips otherwise).
Godot plugin layer (GDScript)
Python backend layer
Security and trust model
Double gate: user settings (file edits off by default; approval modes review / assisted / autopilot / yolo; per-run file and line caps) → SafetyManager.gd and safety.py (blocked paths like addons/, .godt//.godot/, project.godot; dangerous operation blacklist; review requires UI approval) → writes go through backup, optional git checkpoint, and diff-panel revert. API keys live in .env / .godotter_api_key* / config.json, all gitignored.
Distinctive workflows
Boundaries and extension
Explicit non-goals: not a replacement for learning Godot, not a managed SaaS (backend must run locally), not a general-purpose IDE. Extension points: new slash commands/chat modes in ForgeDock.gd + backend endpoints; new tools in app.py + code_tools + safety rules; new LLM providers in gemini_client.py / ai_model_settings.py; new context sources via EditorBridge / project_indexer / memory_store.