You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mcp): sequant://install is computed once at server start and swallows errors — reports "not installed" after a later init or on any read error #1195
Epic: field-2026-09-28 (downstream non-Node adoption) Tier: mechanical Status: confirmed by code reading (2026-09-29), narrowed to AC-1 + AC-2 by owner decision Graph: tracker #1203
Problem.installed means only that a manifest existed when serve started (serve.ts:60-61, version-preflight.ts:110-113, resources.ts:178-181). The value is wrapped in .catch(() => null), so an error reads as "not installed". A manifest written after the server started is never seen until a restart. It also ignores whether skills are present.
Field evidence. Plausible, not reproduced. A downstream project wrote its manifest hours after the plugin MCP server likely started, and runs worked while the resource said "not installed".
Reproduce first. The symptom ("not installed" while runs work) was reported but not reproduced. Before exec: start sequant serve, then write .sequant-manifest.json, read sequant://install, and record the result here. If it can't be reproduced, close this issue, or narrow it to AC-2 (errors are swallowed as "not installed").
AC
AC-1: A manifest created after server start is reported installed on the next read without a restart. Evidence: npx vitest run src/mcp/install-resource.test.ts
AC-2: A read error is reported as {error}, distinct from {installed:false}. Evidence: npx vitest run src/mcp/install-resource.test.ts
AC-3: The resource reports which required phase skills are present under .claude/skills/. Dropped by owner decision (2026-09-29). It's a new feature, not the reported symptom.
Context for the run (re-checked against main @ a12c441d, 2026-09-29)
Owner decision: this issue is narrowed to AC-1 and AC-2, and AC-3 is dropped (see the body). The "reproduce first" gate is satisfied by reading the code:
src/commands/serve.ts:60-61: const install = await getSkillsInstallStatus().catch(() => null); runs once at startup, and the result is passed as createServer(version, { install }).
src/mcp/resources.ts:178-181: installResourceBody maps any falsy install to { installed: false }. A thrown read error (swallowed into null) is therefore indistinguishable from "no manifest" (AC-2), and a manifest written after start is never seen (AC-1).
src/commands/version-preflight.ts:94-114: getSkillsInstallStatus returns null when getManifest() finds none. That's the legitimate "not installed" case, and it must stay {installed:false}.
Shape of the fix
Compute the install body per read of sequant://install. For example, pass a function (a status provider) in ResourceContext instead of a precomputed value, and have the resource await it inside its read handler.
Keep the startup stderr warning (formatSkillsInstallWarning, serve.ts:65) as a one-shot at start. It's fine for that to stay a snapshot.
Error path: catch inside the read and return { error: <message> }. Never collapse it into { installed: false }.
The tests belong in src/mcp/install-resource.test.ts, which already exists. Extend it rather than creating a new file. AC-1's test must write the manifest after the server/context is created and then read the resource.
No changes outside the "May touch" list.
Standard block
No full npm test in exec or in qa. This applies to the qa phase as well as exec. Run targeted suites in the foreground with a timeout: timeout 600 npx vitest run src/mcp/install-resource.test.ts (plus any existing resources/serve test you touch). Global setup runs npm run build first.
Commit WIP early, and always before any mutation.
A mutation marker's failedTest starts with the test file path.
Both AC pass lint (declared Evidence: clause, unambiguous description, no vague/unmeasurable language). ## Non-Goals heading not present, but the issue body's "Dropped by owner decision" line on AC-3 and the "May touch" list serve the same scope-boundary function.
AC-1: Manifest created after server start is reported installed on next read, no restart
Verification: Unit Test (declared evidence) Scenario: Given a server started with no .sequant-manifest.json → When the manifest is written after start, then sequant://install is read → Then response is {installed:true,...}, not {installed:false}.
AC-2: Read error reported as {error}, distinct from {installed:false}
Verification: Unit Test (declared evidence) Scenario: Given a status provider that throws/rejects → When sequant://install is read → Then response is {error:<message>}, never collapsed into {installed:false}.
Implementation Plan
Phase 1: Recompute install status per resource read
src/mcp/resources.ts: change ResourceContext.install from a precomputed value to a provider () => Promise<SkillsInstallStatus | null>. Add { error: string } to InstallResourceBody. Make installResourceBody async: await context.install?.() in try/catch — success/null → {installed:true,...}/{installed:false}; throw/reject → {error: message}. Await it in the install resource's read handler (resources.ts:162-171).
src/commands/serve.ts: keep the one-shot getSkillsInstallStatus().catch(() => null) call only for the startup stderr warning (unchanged — stays a snapshot). Pass a fresh provider to createServer's context: { install: () => getSkillsInstallStatus() } — no .catch, so a throw reaches the handler's try/catch instead of collapsing to null (today's bug).
Phase 2: Tests (extend src/mcp/install-resource.test.ts, don't add a new file)
Update existing connect()/STALE-based cases for the new function-typed install field (e.g. install: async () => STALE).
Add AC-1 case: build server/context, then write the manifest, then read sequant://install — assert installed:true without reconnecting.
Add AC-2 case: provider that rejects — assert {error: <message>}.
No changes needed to version-preflight.ts — getSkillsInstallStatus already returns a fresh promise each call.
Design Review
Where does this logic belong?src/mcp/resources.ts keeps owning resource-body shaping; when status is computed becomes the caller's choice via an injected thunk, consistent with ResourceContext already being a DI seam (serve supplies real deps, tests supply fakes).
Fixed by #1225 (squash 66ce8c46 on main). Closed by hand: the PR's closing reference was dropped when its body was rewritten over the API, reappeared in closingIssuesReferences minutes later, and still didn't close the issue on merge.
Activity
admarble commentedon Sep 30, 2026
Context for the run (re-checked against
main@a12c441d, 2026-09-29)Owner decision: this issue is narrowed to AC-1 and AC-2, and AC-3 is dropped (see the body). The "reproduce first" gate is satisfied by reading the code:
src/commands/serve.ts:60-61:const install = await getSkillsInstallStatus().catch(() => null);runs once at startup, and the result is passed ascreateServer(version, { install }).src/mcp/resources.ts:14-19:ResourceContext.installis documented as "computed once at startup byserve(fix(cli): preAction auto-sync fires onserve— the plugin's @latest MCP server silently rewrites .claude/hooks, skills, AGENTS.md in every project it starts in (#793 pin never ships via marketplace source "./") #988)".src/mcp/resources.ts:178-181:installResourceBodymaps any falsyinstallto{ installed: false }. A thrown read error (swallowed intonull) is therefore indistinguishable from "no manifest" (AC-2), and a manifest written after start is never seen (AC-1).src/commands/version-preflight.ts:94-114:getSkillsInstallStatusreturnsnullwhengetManifest()finds none. That's the legitimate "not installed" case, and it must stay{installed:false}.Shape of the fix
sequant://install. For example, pass a function (a status provider) inResourceContextinstead of a precomputed value, and have the resourceawaitit inside its read handler.formatSkillsInstallWarning,serve.ts:65) as a one-shot at start. It's fine for that to stay a snapshot.{ error: <message> }. Never collapse it into{ installed: false }.src/mcp/install-resource.test.ts, which already exists. Extend it rather than creating a new file. AC-1's test must write the manifest after the server/context is created and then read the resource.Standard block
npm testin exec or in qa. This applies to the qa phase as well as exec. Run targeted suites in the foreground with a timeout:timeout 600 npx vitest run src/mcp/install-resource.test.ts(plus any existingresources/servetest you touch). Global setup runsnpm run buildfirst.failedTeststarts with the test file path.Closes #1195. UseRefsonly for the tracker, tracker(graph): field report 2026-09-28 — downstream non-Node adoption gaps (10 nodes) #1203..sequant/settings.jsonmust handle JSONC (not expected to apply here).admarble commentedon Sep 30, 2026
Complexity: Simple (2 ACs, 2 directories)
AC Quality Check
Both AC pass lint (declared
Evidence:clause, unambiguous description, no vague/unmeasurable language).## Non-Goalsheading not present, but the issue body's "Dropped by owner decision" line on AC-3 and the "May touch" list serve the same scope-boundary function.Scope Assessment
Verdict: ✅ SCOPE_OK (trivial — 2 AC, 0 directories per feature-detection heuristic; touches
src/mcp/+src/commands/)Acceptance Criteria
AC-1: Manifest created after server start is reported installed on next read, no restart
Verification: Unit Test (declared evidence)
Scenario: Given a server started with no
.sequant-manifest.json→ When the manifest is written after start, thensequant://installis read → Then response is{installed:true,...}, not{installed:false}.AC-2: Read error reported as
{error}, distinct from{installed:false}Verification: Unit Test (declared evidence)
Scenario: Given a status provider that throws/rejects → When
sequant://installis read → Then response is{error:<message>}, never collapsed into{installed:false}.Implementation Plan
Phase 1: Recompute install status per resource read
src/mcp/resources.ts: changeResourceContext.installfrom a precomputed value to a provider() => Promise<SkillsInstallStatus | null>. Add{ error: string }toInstallResourceBody. MakeinstallResourceBodyasync:await context.install?.()in try/catch — success/null →{installed:true,...}/{installed:false}; throw/reject →{error: message}. Await it in theinstallresource's read handler (resources.ts:162-171).src/commands/serve.ts: keep the one-shotgetSkillsInstallStatus().catch(() => null)call only for the startup stderr warning (unchanged — stays a snapshot). Pass a fresh provider tocreateServer's context:{ install: () => getSkillsInstallStatus() }— no.catch, so a throw reaches the handler's try/catch instead of collapsing tonull(today's bug).Phase 2: Tests (extend
src/mcp/install-resource.test.ts, don't add a new file)connect()/STALE-based cases for the new function-typedinstallfield (e.g.install: async () => STALE).sequant://install— assertinstalled:truewithout reconnecting.{error: <message>}.No changes needed to
version-preflight.ts—getSkillsInstallStatusalready returns a fresh promise each call.Design Review
src/mcp/resources.tskeeps owning resource-body shaping; when status is computed becomes the caller's choice via an injected thunk, consistent withResourceContextalready being a DI seam (servesupplies real deps, tests supply fakes).StatusToolOptionsinsrc/mcp/tools/status.ts(test(mcp): sequant_status tests reconcile and rewrite the checkout's real .sequant/state.json #1164) — test/production swap a dependency through the context object rather than a hardcoded value.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: disabled
Reasoning:
buglabel only, 2 AC, SCOPE_OK, owner decision already specifies the exact fix shape — no testgen (bug-only label short-circuits it), no security-review, no UI.Label Review
Current: bug, graph-2026-09-field
Recommended: +
plannedReason: Plan accepted, ready for exec.
Quality Loop: Won't auto-enable — SCOPE_OK, no complexity signal.
→
gh issue edit 1195 --add-label plannedadmarble commentedon Sep 30, 2026
QA Verdict: AC_NOT_MET
admarble commentedon Sep 30, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 2/2 met
Gaps:
test(#1195): serve's resource context wiring is regression-tested via…
test(#1195): name the real-provider describe for both ACs
fix(#1195): sequant://install recomputes on every read and reports a …
admarble commentedon Sep 30, 2026
Fixed by #1225 (squash
66ce8c46onmain). Closed by hand: the PR's closing reference was dropped when its body was rewritten over the API, reappeared inclosingIssuesReferencesminutes later, and still didn't close the issue on merge.