09800d192a
Phase 2 commit #7 (final) per docs/PHASE2.md §12. Two changes bundled: (1) commented-out mcp = {...} example block (~40 lines) at the end of config.lua showing the Phase 2 schema: - mcp.servers — alias → {url, auth_token | auth_env} - mcp.auto_approve — "<alias>.<tool>" or "<alias>.*" globs - mcp.max_tool_depth — sub-loop budget per ask_ai turn The block is OFF by default; uncomment + adjust per fleet to activate. Documentation-only; no behavior change to existing configs (mcp_sessions stays empty, tools_schema() returns [], broker omits the field — full Phase 1 compatibility). (2) User-authored: deep model preset switched from mistral-nemo-12b-instruct to qwen3-30b-a3b-instruct, with a 10-min timeout_ms accommodating the larger model's RK3588 inference time. Reason: nemo backend is dormant per the proxy /v1/models discovery (aish#23 now returns 404 cleanly for unknown models instead of silent fallback); qwen3-30b is the practical "deep" alternative. Phase 2 implementation is now complete — 7 of 7 commits landed: #16c194demcp.lua + ffi/curl status_code + PHASE0 §4 amendment #20fde77fsafety.lua confirm_tool_call #37c221a8context.lua tool turns + use_tool_role fallback #4c736d0erenderer.lua tool-call frames #5efdc728broker.lua opts.tools + tool_call accumulator #67e9cfffrepl.lua sub-loop + :mcp meta + system-prompt block #7 (this) config.lua example + deep model switch Next phase-loop step: verify (Phase 7). Files written are wired and isolated-tested; end-to-end model-driven verification waits on either a more compliant model or explicit forcing of tool_calls from the prompt — known to be marginal with the loaded qwen-1.5b but proven correct against direct probes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
93 lines
3.5 KiB
Lua
93 lines
3.5 KiB
Lua
-- config.lua — model registry, routing rules, user preferences.
|
|
-- Loaded with dofile() at startup; returns a plain Lua table.
|
|
-- See docs/PHASE0.md §10 for resolution order and full schema.
|
|
--
|
|
-- Per issue #12: hossenfelder is the canonical single-URL broker. It does
|
|
-- model-aware routing server-side (local models on boltzmann; cloud routes
|
|
-- through OpenRouter using its own bearer auth — no client-side key here).
|
|
-- Discovery: GET http://hossenfelder.fritz.box:8082/v1/models.
|
|
|
|
local HOSSENFELDER = "http://hossenfelder.fritz.box:8082"
|
|
|
|
return {
|
|
default_model = "fast",
|
|
|
|
models = {
|
|
fast = {
|
|
endpoint = HOSSENFELDER,
|
|
model = "qwen2.5-coder-1.5b-q4_k_m.gguf",
|
|
temperature = 0.2,
|
|
},
|
|
deep = {
|
|
endpoint = HOSSENFELDER,
|
|
model = "qwen3-30b-a3b-instruct",
|
|
timeout_ms = 1800000, -- 10 min; Nemo on RK3588 is patient work
|
|
temperature = 0.1,
|
|
},
|
|
cloud = {
|
|
endpoint = HOSSENFELDER,
|
|
model = "anthropic/claude-haiku-4.5",
|
|
temperature = 0.2,
|
|
},
|
|
},
|
|
|
|
shell = {
|
|
known_commands = {
|
|
"ls", "cat", "cd", "grep", "find", "cp", "mv", "rm",
|
|
"mkdir", "rmdir", "git", "make", "cmake", "gcc", "clang",
|
|
"python3", "luajit", "ssh", "scp", "curl", "wget",
|
|
},
|
|
capture_output = true, -- inject exec output into context
|
|
confirm_cmd = true, -- prompt before executing CMD: suggestions
|
|
},
|
|
|
|
context = {
|
|
max_turns = 40,
|
|
token_budget = 4096,
|
|
},
|
|
|
|
history = {
|
|
dir = (os.getenv("HOME") or ".") .. "/.local/share/aish",
|
|
},
|
|
|
|
-- Phase 2 (docs/PHASE2.md): MCP server registry + tool-call policy.
|
|
-- The block is OFF by default — connect-at-startup happens only when
|
|
-- `servers` is non-empty. Uncomment + adjust per your fleet.
|
|
--
|
|
-- mcp = {
|
|
-- servers = {
|
|
-- -- Each entry: alias = { url = "...", auth_token = "..." | auth_env = "..." }
|
|
-- -- auth_token literal > auth_env env-var indirection > nil (no auth).
|
|
-- -- Aliases become the namespace prefix on tool names sent to the model
|
|
-- -- ("<alias>.<tool>" — e.g. "boltzmann.list_dir").
|
|
-- boltzmann = {
|
|
-- url = "http://boltzmann.fritz.box:8080/mcp",
|
|
-- auth_env = "BOLTZMANN_MCP_TOKEN",
|
|
-- },
|
|
-- hertz = {
|
|
-- url = "http://hertz.fritz.box:8080/mcp",
|
|
-- auth_env = "HERTZ_MCP_TOKEN",
|
|
-- },
|
|
-- broglie = {
|
|
-- url = "http://broglie.fritz.box:8080/mcp", -- LAN-only, no auth
|
|
-- },
|
|
-- },
|
|
--
|
|
-- -- Per-call confirm gate auto-approve policy.
|
|
-- -- Key forms:
|
|
-- -- "<alias>.<tool>" — auto-approve one specific tool
|
|
-- -- "<alias>.*" — auto-approve every tool on that server
|
|
-- -- Anything not matched falls back to the [y/N] prompt.
|
|
-- auto_approve = {
|
|
-- ["boltzmann.read_file"] = true,
|
|
-- ["boltzmann.list_dir"] = true,
|
|
-- ["boltzmann.search_files"] = true,
|
|
-- ["hertz.*"] = true, -- trust the hub fully
|
|
-- },
|
|
--
|
|
-- -- Tool-call sub-loop budget per ask_ai turn. Hitting the cap surfaces
|
|
-- -- a status and breaks; default 8 if absent.
|
|
-- max_tool_depth = 8,
|
|
-- },
|
|
}
|