Repository navigation
architecture runtime
github-actions[bot] edited this page Oct 31, 2026
·
53 revisions
internal/agent/runtime/ is Solomon's orchestration core: the Runtime type, REPL loop wiring, LLM turn execution, tool dispatch, MCP, checkpoints, and integrations. This page is the index; detail lives in linked articles.
flowchart TB
cmd[cmd/solomon]
repl_run[repl_run.go Run]
repl_pkg[repl/]
replcomplete[replcomplete/]
slash_deps[slash_deps.go]
turns[turns.go]
core[core.go]
exec[exec.go]
cmd --> repl_run
repl_run --> repl_pkg
repl_pkg --> slash_deps
repl_pkg --> turns
turns --> core
turns --> exec
repl_pkg --> replcomplete
repl_run --> core
Flow: Runtime.Run (repl_run.go) builds a repl.Loop. Chat lines call onUserMessage → runAgentTurns in turns.go. Slash lines call slash_deps.handleSlash → slash.Dispatch.
| Article | Topics |
|---|---|
| Runtime — REPL input | Raw-mode editor, completion, @ mentions, highlight, shell history |
| Runtime — orchestration | Turns, tools, MCP, legacy XML, nested subagent, CI mode, checkpoints |
| Deep research | Background research jobs, internal web adapters, persistence, and cross-surface status |
| Agent turn pipeline | Stream loop sequence, compaction, legacy XML rules |
| Checkpoints |
/goto, staging, file restore |
| File | Responsibility | Called from / calls |
|---|---|---|
core.go |
Runtime struct, NewRuntime, RunPromptOnce, systemPrompt, persistSession, session mutation |
cmd, REPL callbacks, turns
|
repl_run.go |
Run — banner, MCP goroutine, repl.Loop wiring, clipboard hooks |
cmd |
turns.go |
onUserMessage, runAgentTurns, stream + tool loop, SIGINT cancel |
repl/loop, RunPromptOnce
|
exec.go |
execTool, toolEnv → tools.Exec
|
turns |
legacy.go |
ResolveTurnInvocations, legacy config helpers |
turns |
tool_print.go |
Terminal tool lines, legacy stream writer setup, correction messages | turns |
nested.go |
runNested, subagent stream (build tools + optional custom prompt) |
tools/subagent |
mcp.go |
InitMCP, MCP tools in toolParams
|
Run, turns
|
slash_deps.go |
slashDeps, handleSlash, commands.Deps callbacks |
repl/loop |
usershell.go |
runUserShellLine for ! / shell-first lines |
repl/loop |
checkpoint.go |
ApplyGotoCheckpoint, edit staging on rewind |
slash /goto, turns
|
instructions.go |
Activate AGENTS.md dirs after tools/shell touch paths |
exec, shell
|
ci_run.go |
exec --json / --jsonl event emission, machine-mode stream opts |
RunPromptOnce, turns
|
deferred_chat_title.go |
Background chat title finalize after first turn | turns |
cursor_sidecar.go |
ensureCursorSidecar for Cursor API provider |
/connect, tool env |
cursor_native_display.go |
Legacy Cursor native tool event display (deprecated with cursor_internal_tools) |
stream callbacks |
update.go |
GitHub release check, startup autoupdate install, /update
|
Run, /update
|
restart.go |
ErrRestartSolomon for in-process restart after upgrade |
slash /upgrade → cmd
|
replcomplete_runtime.go |
Build replcomplete.ReplCompleteEnv from Runtime
|
repl_run |
| Path | Role | Detail |
|---|---|---|
repl/ |
Interactive input loop, editor, banner, display | Runtime — REPL input |
replcomplete/ |
Tab completion and @ index |
Runtime — REPL input |
multiline/ |
Bracketed paste, terminal raw mode, platform stdin | Runtime — REPL input |
repl/replhl/ |
Draft-line syntax highlight | Runtime — REPL input |
repl/shellhist/ |
History for shell/! lines |
Runtime — REPL input |
repl/shelllex/ |
Shell tokenization for highlight/completion | Runtime — REPL input |
| Field | Role |
|---|---|
RL |
readline instance — terminal writers/width; prompt editing is in repl editor |
Backend, Model, Cfg, Prov
|
Active LLM provider |
ProjHex, ProjRoot
|
Canonical workspace |
Mode |
plan or build
|
Session |
In-memory transcript |
EphemeralSession |
Skip chatstore writes |
ReplShellFirst |
Plain lines → shell; ! → chat |
MCP |
Connected MCP manager |
ToolOut |
Tool result truncation/spill |
Instructions |
Cached AGENTS.md loader |
EventSink, FailOnToolError
|
CI / machine output |
CompactionThresholdTokens |
Auto /summarize threshold |
stagingCache |
Checkpoint file snapshots for /goto
|
Full struct: core.go.
Disable completion: SOLOMON_NO_COMPLETE=1. Disable autosuggest ghost text: SOLOMON_NO_AUTOSUGGEST=1.
| Change | Where |
|---|---|
| REPL keys / redraw |
repl/editor/read.go, repl/editor/refresh.go
|
| New slash command |
commands/builtin_slash.go — not runtime, wired via slash_deps
|
| Turn loop / tools |
turns.go, exec.go
|
| System prompt sections |
core.go systemPrompt
|
REPL tests can import editor helpers via repl/editor/editorhistory.go (test-only exports).