Skip to content

[bug] wiki_refine_draft with only a draft_id stamps synth_model and writes a refined_llm memo #583

Closed

Description

@cdeust

What happened

wiki_refine_draft (mcp_server/handlers/wiki_refine.py::handler_refine) accepts a call carrying nothing but draft_id. title, lead, sections and frontmatter are all optional and update_draft skips every field that is None, but synth_model defaults to claude_refine_v1 and is always passed, so the update touches a row, returns updated: true, and insert_memo writes a refined_llm row into wiki.memos.

A call that refines nothing therefore leaves an audit trail saying a model refined the draft, and stamps the draft's synth_model with a model that did not write its content. Since #579 the tool is registered, so any MCP client can make that call.

Found by the review of PR #581 (#581 (comment)). The behavior predates that PR; exposing the tool is what makes it reachable.

Expected behavior

A refinement carries content. When title, lead, sections and frontmatter are all absent, the handler returns an error naming what it expects and writes nothing: no synth_model, no memo.

Evidence required to close

A test that calls the handler with only a draft_id and asserts the draft row and wiki.memos are both unchanged, and that the response is an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions