Skip to content

mcpx(daemon): task-store Open failure silently falls back to in-memory — durability claimed by PR #1575 can vanish with no log line #2007

Closed

Description

@dezren39

Finding

daemon.Server.taskStore() (pkgs/mcpx/internal/daemon/ops.go, current main 77918e0f) opens the durable SQLite task store and drops the error unconditionally:

if s.paths.State != "" {
    dbPath := filepath.Join(s.paths.State, "tasks.db")
    if store, err := tasks.Open(dbPath); err == nil {
        s.tasks = store
    }
}
if s.tasks == nil {
    s.tasks = tasks.New()   // in-memory fallback, no log, no record
}

There is no log call anywhere in the function. The daemon has a logger and uses it for exactly this kind of degradation elsewhere (pkgs/mcpx/internal/daemon/server.go: opts.Logger.Printf("elicitation disabled: %v", berr)), but a failed task-store open is completely silent. Because creation is sync.Once, the fallback is also sticky for the life of the process: a transient failure at first use downgrades the daemon permanently, with no retry.

Evidence

Why it matters

When the open fails, three things go wrong at once, all invisibly:

  1. Every task already persisted in tasks.db becomes unreachable — the daemon never opened the file, so MCP and /v1 both report those tasks as unknown.
  2. Every new task is memory-only and evaporates on daemon restart — precisely the failure the conformance matrix now says is covered.
  3. Nobody can diagnose it: no log line names the path or the error, so the symptom ("tasks disappeared") has no on-box evidence trail.

Acceptance criteria

  • A failed tasks.Open in taskStore() is logged once via the daemon logger (s.logger), naming the db path and the underlying error, before the in-memory fallback is installed.
  • A regression test pins it: a daemon server whose tasks.db cannot be opened (e.g. corrupt file contents or an unusable state path) falls back and emits the log line; the successful-open path stays silent-or-unchanged and still returns the one shared store instance.
  • The fallback remains a fallback (daemon keeps serving) — this issue asks for visibility, not a hard failure.
  • Existing task-store tests keep passing (internal/daemon/taskstore_shared_test.go, internal/mcpserver/tasks_shared_store_test.go).

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  5. 13 remaining items

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
    • Session / ID: task 5067
    • Task: Log tasks.Open failures before the unchanged in-memory fallback.
    • Result: PR fix(mcpx): log task store open fallback #4055 is OPEN at 6fd77b9c9; task 5067 completed as pr_opened. user/review marks the handoff while CI runs. The PR is authored by dezren39 (Drewry Pope), so this lane will not modify or merge it.
    • Verification: regression reproduced red before the fix, then passed; daemon, tasks, and injected-store MCP tests passed.
    • Links: task 5067, PR fix(mcpx): log task store open fallback #4055
  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as small_fix at priority 50 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (already fixed at current main)

  10. removed
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    queue/queuedHas a queued task in the Supabase agent queue
    status/triagedTriaged and routed (see agent note)
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions