fix(mcp): migrate OpenCode defaults to GPT-6.1 Sol
setup / install-leaves-tree-clean (push) Canceled after 0s
setup / install-leaves-tree-clean (push) Canceled after 0s
Replace retired ChatGPT Codex GPT-5.5 defaults with GPT-6.1 Sol. Use low reasoning for queries and retain high reasoning for ingestion. Update config examples, operator guidance, and service default assertions. Validation: 168 MCP tests passed; live OAuth model invocation returned MODEL_OK; restarted service reports the new model and variants.
This commit is contained in:
+3
-3
@@ -111,7 +111,7 @@ OBSIDIAN_MCP_INGEST_MAX_REQUEST_BYTES=0
|
||||
OBSIDIAN_MCP_INGEST_JOB_TIMEOUT_SECONDS=1800
|
||||
OBSIDIAN_MCP_OPENCODE_PATH=opencode
|
||||
OBSIDIAN_MCP_INGEST_OPENCODE_PATH=opencode
|
||||
OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5
|
||||
OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol
|
||||
OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high
|
||||
OBSIDIAN_MCP_INGEST_RUNTIME_ROOT=.runtime/mcp-ingest
|
||||
|
||||
@@ -123,8 +123,8 @@ OBSIDIAN_MCP_INGEST_RUNTIME_ROOT=.runtime/mcp-ingest
|
||||
# pages. Use OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,query or:
|
||||
# bash scripts/mcp_service.sh tools enable query
|
||||
# bash scripts/mcp_service.sh start --enable-query
|
||||
OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5
|
||||
OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal
|
||||
OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol
|
||||
OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low
|
||||
OBSIDIAN_MCP_QUERY_MAX_CHARS=8000
|
||||
OBSIDIAN_MCP_QUERY_JOB_TIMEOUT_SECONDS=300
|
||||
OBSIDIAN_MCP_QUERY_RUNTIME_ROOT=.runtime/mcp-query
|
||||
|
||||
@@ -133,7 +133,7 @@ See `wiki-query` and `wiki-export` skills for how the filter is applied.
|
||||
- **Keep remote ingest gated.** MCP ingest tools are write-capable and must remain disabled unless the service config explicitly enables the `ingest` tool group via `OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,ingest`, `mcp_service.sh tools enable ingest`, or `mcp_service.sh start --enable-ingest`. Uploaded files and direct text notes must stage outside the vault under the MCP runtime root; `wiki-ingest` is responsible for accepting, archiving, and indexing sources inside the vault. Use `ingest_text_note` only for short remote-agent thoughts/notes; it must wrap the text as a temporary markdown upload and then use the fixed `/wiki-ingest` job path. Remote agents should use `create_ingest_upload_ticket` and the returned `upload_url` plus `X-Obsidian-Wiki-Upload-Token` for HTTP multipart uploads; bearer-token uploads remain only for local/admin compatibility. Prefer `start_job=false`, then `preview_upload_metadata`, then `start_ingest_job` after the preview looks correct. `validate_upload` and `preview_upload_metadata` may report exact sha256 duplicates, but must not claim fuzzy dedupe. Upload tickets are consumed only by authorized `POST` uploads, the upload endpoint must enforce configured host/origin restrictions, and oversized request bodies must fail with HTTP `413`. Do not expose base64 or chunked upload tools in the MCP tool surface. They may launch local OpenCode only through the fixed `/wiki-ingest` prompt; never expose arbitrary prompt or shell execution through MCP. Remote ingest responses must not expose local runtime paths; internal job records may keep paths for the fixed local prompt. Remote ingest must keep the OpenCode readiness preflight in front of job launch, and `check_ingest_opencode_readiness(run_smoke_test=true)` should stay available for operators to verify that OpenCode can load the project `wiki-ingest` skill before accepting uploads.
|
||||
- **Keep remote ingest status authoritative.** Preserve the `queued`, `preflight`, `agent_running`, `verifying`, and `complete` phases. Compute `process_alive` only from process-supervisor ownership while `phase=agent_running`; do not infer semantic activity from logs or elapsed time. Treat `MCP_INGEST_OK` as permission to begin deterministic verification, not as final success. Final `state=succeeded` requires registry, manifest, file-index, configured archive, and declared output-path checks to pass. A failed verification must finish with `state=failed`, preserve partial outputs for diagnosis, and report compact path-redacted failures.
|
||||
- **Keep remote query gated.** MCP query tools must remain disabled unless the service config explicitly enables the `query` tool group via `OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,query`, `mcp_service.sh tools enable query`, or `mcp_service.sh start --enable-query`. They may launch local OpenCode only through the fixed `/wiki-query` prompt, with no arbitrary prompt or shell execution. `ask_wiki` is the preferred remote-agent query entrypoint; the async `start_wiki_query`/status/result tools remain available for long jobs. `public_only` defaults to false, meaning remote answers may use the full local vault visibility; enable the tool group only for trusted clients and set `public_only=true` per call for filtered user-facing answers. Remote query responses may expose log tails but must not expose local log file paths, and structured fields such as `answer_markdown`, `citations`, `warnings`, and `confidence` must remain backward-compatible with the legacy `answer` field.
|
||||
- **Keep OpenCode model choice server-side.** MCP clients must not pass arbitrary model names through ingest/query tools. Configure local defaults in `.runtime/obsidian-wiki-mcp.env`: ingest uses `OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5` with `OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high`; query uses `OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5` with `OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal`.
|
||||
- **Keep OpenCode model choice server-side.** MCP clients must not pass arbitrary model names through ingest/query tools. Configure local defaults in `.runtime/obsidian-wiki-mcp.env`: ingest uses `OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol` with `OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high`; query uses `OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol` with `OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low`.
|
||||
|
||||
## Core Principles
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ This adds write-capable MCP tools to the same `wiki-file-assets` server and bear
|
||||
- `start_ingest_job` — queues a local `opencode run --auto --format json` job with a fixed `/wiki-ingest` prompt for the completed uploads.
|
||||
- `get_ingest_job_status`, `get_ingest_job_result`, `cancel_ingest_job` — inspect or cancel the local job.
|
||||
|
||||
The managed service config sets the OpenCode model server-side. By default ingest uses `OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5`, `OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high`, and an `OBSIDIAN_MCP_INGEST_JOB_TIMEOUT_SECONDS=1800` deadline. It also writes `OBSIDIAN_MCP_PUBLIC_BASE_URL` from the detected remote address so ticket responses can include a complete upload URL; set it manually when the service is behind a tunnel, reverse proxy, or custom DNS name. If the upload endpoint is exposed through a different public URL than `/mcp`, set `OBSIDIAN_MCP_INGEST_PUBLIC_UPLOAD_URL` explicitly and it will override the derived upload URL in capabilities, upload instructions, tickets, and `show-config`. Change these values in `.runtime/obsidian-wiki-mcp.env` on the server if needed; remote MCP clients do not choose the model per call.
|
||||
The managed service config sets the OpenCode model server-side. By default ingest uses `OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol`, `OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high`, and an `OBSIDIAN_MCP_INGEST_JOB_TIMEOUT_SECONDS=1800` deadline. It also writes `OBSIDIAN_MCP_PUBLIC_BASE_URL` from the detected remote address so ticket responses can include a complete upload URL; set it manually when the service is behind a tunnel, reverse proxy, or custom DNS name. If the upload endpoint is exposed through a different public URL than `/mcp`, set `OBSIDIAN_MCP_INGEST_PUBLIC_UPLOAD_URL` explicitly and it will override the derived upload URL in capabilities, upload instructions, tickets, and `show-config`. Change these values in `.runtime/obsidian-wiki-mcp.env` on the server if needed; remote MCP clients do not choose the model per call.
|
||||
|
||||
For short text thoughts, notes, findings, or pasted context, call `ingest_text_note(text, title?, project?, doc_type_hint?, note?, start_job?)`. It uses `doc_type_hint="thought"` and `start_job=false` by default, returning a one-item Bundle and the staged upload; it also returns the queued job when `start_job=true` is explicitly requested.
|
||||
|
||||
@@ -520,7 +520,7 @@ This adds read-oriented OpenCode-backed query tools to the same `wiki-file-asset
|
||||
- `start_wiki_query` — queues a local `opencode run --auto --format json` job with a fixed `/wiki-query` prompt. Parameters: `query`, `mode` (`normal` or `index_only`), `public_only` (default `false`), and optional `note`.
|
||||
- `get_wiki_query_status`, `get_wiki_query_result`, `cancel_wiki_query` — inspect, retrieve, or cancel the local query job.
|
||||
|
||||
The managed service config sets query to `OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5`, `OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal`, and `OBSIDIAN_MCP_QUERY_JOB_TIMEOUT_SECONDS=300` by default, prioritizing response speed over maximum reasoning depth. Tune the server env file if a different balance is needed.
|
||||
The managed service config sets query to `OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol`, `OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low`, and `OBSIDIAN_MCP_QUERY_JOB_TIMEOUT_SECONDS=300` by default, prioritizing response speed over maximum reasoning depth. Tune the server env file if a different balance is needed. GPT-6.1 Sol balances multi-step document/tool work and cost; query uses `low` for latency while ingest uses `high` for synthesis and metadata maintenance. GPT-5.5 retired from Codex with ChatGPT sign-in on October 14, 2026 ([model availability](https://learn.chatgpt.com/docs/models)). Existing installations must update their saved env file and restart the service; changing these defaults does not overwrite saved settings.
|
||||
|
||||
`public_only` defaults to `false`, so the answer may use the same full vault visibility that a local operator sees. Set `public_only=true` when the remote answer must exclude `visibility/internal` and `visibility/pii` pages. Job state and logs live under `.runtime/mcp-query/jobs/`, outside the vault; remote query status/result responses expose bounded, path-redacted text and omit local log paths. The final JSON text event must contain `MCP_QUERY_OK`; `MCP_QUERY_FAILED`, a missing marker, a nonzero exit, timeout, or cancellation cannot be reported as a successful answer. Query results keep the legacy `answer` field and also include `answer_markdown`, `citations`, `used_wiki`, `used_business_facts`, `data_freshness`, `warnings`, and `confidence` so agents can parse the response without scraping raw logs. A normal `wiki-query` log entry is allowed. The generated prompt instructs the agent to avoid ingest/update/rebuild workflows, writes, sync/config/timer operations, and arbitrary shell execution; it only permits the `obsidian-wiki business schema/template/sql` read-only commands needed by the wiki-query business facts route, but these prompt restrictions do not replace the trusted-client boundary described above. Hybrid business + wiki questions may run a wiki context track and a business facts track, using parallel subagents only when the host supports them and otherwise running sequentially. When `public_only=true`, business facts remain disabled.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ DEFAULT_INGEST_MAX_REQUEST_BYTES = 0
|
||||
DEFAULT_UPLOAD_TICKET_SECONDS = 30 * 60
|
||||
MAX_UPLOAD_TICKET_SECONDS = 24 * 60 * 60
|
||||
DEFAULT_OPENCODE_PATH = "opencode"
|
||||
DEFAULT_INGEST_OPENCODE_MODEL = "openai/gpt-5.5"
|
||||
DEFAULT_INGEST_OPENCODE_MODEL = "openai/gpt-6.1-sol"
|
||||
DEFAULT_INGEST_OPENCODE_VARIANT = "high"
|
||||
DEFAULT_OPENCODE_SMOKE_TIMEOUT_SECONDS = 120
|
||||
DEFAULT_INGEST_JOB_TIMEOUT_SECONDS = 30 * 60
|
||||
|
||||
@@ -19,8 +19,8 @@ from obsidian_wiki.mcp_jobs import ProcessOutcome, ProcessSupervisor, extract_fi
|
||||
|
||||
DEFAULT_QUERY_MAX_CHARS = 8000
|
||||
DEFAULT_OPENCODE_PATH = "opencode"
|
||||
DEFAULT_QUERY_OPENCODE_MODEL = "openai/gpt-5.5"
|
||||
DEFAULT_QUERY_OPENCODE_VARIANT = "minimal"
|
||||
DEFAULT_QUERY_OPENCODE_MODEL = "openai/gpt-6.1-sol"
|
||||
DEFAULT_QUERY_OPENCODE_VARIANT = "low"
|
||||
DEFAULT_OPENCODE_SMOKE_TIMEOUT_SECONDS = 120
|
||||
DEFAULT_QUERY_JOB_TIMEOUT_SECONDS = 5 * 60
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ ARCHIVE_SOURCES_ENV = "WIKI_ARCHIVE_SOURCES"
|
||||
DEFAULT_TOKEN_BYTES = 32
|
||||
DEFAULT_UV_CACHE_DIR = "/tmp/uv-cache"
|
||||
DEFAULT_OPENCODE_PATH = "opencode"
|
||||
DEFAULT_INGEST_OPENCODE_MODEL = "openai/gpt-5.5"
|
||||
DEFAULT_INGEST_OPENCODE_MODEL = "openai/gpt-6.1-sol"
|
||||
DEFAULT_INGEST_OPENCODE_VARIANT = "high"
|
||||
DEFAULT_QUERY_OPENCODE_MODEL = "openai/gpt-5.5"
|
||||
DEFAULT_QUERY_OPENCODE_VARIANT = "minimal"
|
||||
DEFAULT_QUERY_OPENCODE_MODEL = "openai/gpt-6.1-sol"
|
||||
DEFAULT_QUERY_OPENCODE_VARIANT = "low"
|
||||
DEFAULT_INGEST_JOB_TIMEOUT_SECONDS = 30 * 60
|
||||
DEFAULT_QUERY_JOB_TIMEOUT_SECONDS = 5 * 60
|
||||
DEFAULT_INGEST_MAX_REQUEST_BYTES = 0
|
||||
|
||||
@@ -90,10 +90,10 @@ class McpServiceConfigTests(unittest.TestCase):
|
||||
self.assertIn("https://uploads.example.test", content)
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,ingest\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLE_INGEST=1\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_JOB_TIMEOUT_SECONDS=111\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_JOB_TIMEOUT_SECONDS=22\n", content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_MAX_REQUEST_BYTES=333\n", content)
|
||||
@@ -724,10 +724,10 @@ class McpServiceConfigTests(unittest.TestCase):
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,ingest\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLE_INGEST=1\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_PATH=/home/nac/.opencode/bin/opencode\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low\n", env_content)
|
||||
self.assertIn("http://10.0.0.4:9876/wiki-mcp", output)
|
||||
self.assertIn("Authorization: Bearer created-token", output)
|
||||
self.assertIn('"type": "streamable-http"', output)
|
||||
@@ -819,10 +819,10 @@ class McpServiceConfigTests(unittest.TestCase):
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLED_TOOLS=file-assets,query\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_ENABLE_INGEST=0\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_OPENCODE_PATH=/home/nac/.opencode/bin/opencode\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-5.5\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_MODEL=openai/gpt-6.1-sol\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_INGEST_OPENCODE_VARIANT=high\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-5.5\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=minimal\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_MODEL=openai/gpt-6.1-sol\n", env_content)
|
||||
self.assertIn("OBSIDIAN_MCP_QUERY_OPENCODE_VARIANT=low\n", env_content)
|
||||
self.assertNotIn("OBSIDIAN_MCP_INGEST_OPENCODE_PATH=", env_content)
|
||||
self.assertIn("Enabled tool groups:\nfile-assets,query", output)
|
||||
self.assertIn("Use ask_wiki for ordinary wiki, business facts, or hybrid questions.", output)
|
||||
|
||||
Reference in New Issue
Block a user