PR #1160 follow-ups: web_frontend/server.py's issue-filing form calls Bd.create(body=...), a param it doesn't have nf-jfeh ← Beads

closed priority 2 task bd-papercuts

Twinned from https://github.com/cfsh/ninefold/issues/1167 by tools/beads/import_github.py's reconcile pass.

Suggestions from ninefold-reviewer's review of #1160

Found while reviewing #1160 (design 011 T8-import's --repo-wide bd import), unrelated to that PR's own diff — noting it here rather than blocking that PR on it.

The bug. tools/web_frontend/server.py's _handle_issue_new (POST /issue/new, ~line 1279):

new_id = bd.create(title, type=issue_type, priority=priority, labels=labels, body=body)

nflib.bd.Bd.create() (both the real class and FakeBd) has no body parameter — only body_file: str | None, which expects a path to a file containing the body text, not the text itself. This call raises TypeError: create() got an unexpected keyword argument 'body' on every submission of the web UI's 'file a new issue' form.

This predates #1160 — that PR didn't touch server.py, though its own summary said the --title fix (positional argv to --title <value>) applies 'to every bd.create() caller in the tree... plus web_frontend/server.py's issue-creation path.' That part is narrowly true (the --title mechanism is shared), but it doesn't make this caller work — it's broken for this separate, pre-existing reason both before and after #1160.

Suggested fix. Either add a body: str | None parameter to Bd.create() that writes to a temp file internally (mirroring how import_github.py's callers already do it by hand), or have _handle_issue_new write body to a temp file itself and pass body_file=.

Test plan. A test that actually calls _handle_issue_new (or the underlying bd.create(..., body=...) call) against FakeBd would have caught this — worth adding as a regression test alongside the fix.

Dependencies

None.

Comments

jcantsp-bot · 2026-08-20T14:34:28Z

Not reproducible against current code — closing as stale.

The Bd at tools/web_frontend/server.py's _handle_issue_new call site (line ~1538, bd = Bd()) resolves to server.py's own local Bd class (defined line 145), not nflib.bd.Bd. That local class is deliberately self-contained (see its docstring: "Deliberately not nflib.bd.Bd either ... this file needs to run standalone off a redeploy.py-style copy"), and its create() (line 224) already has a body: str | None = None parameter that goes over --stdin, exactly the shape this issue's "suggested fix" asks for. It landed in #1097 (commit bd048775, 2026-08-18), before #1160 was even opened.

So bd.create(title, type=issue_type, priority=priority, labels=labels, body=body) is a valid call against the class actually in scope there — no TypeError. server_test.py's BdShowCreateCommentTests.test_create_passes_type_priority_labels_and_the_body_over_stdin already exercises this exact call shape and passes.

The finding's premise (that this call reaches nflib.bd.Bd.create(), which has no body param) doesn't hold — that class is never imported into this file. Looks like the reviewer conflated the two Bd classes.

Add a comment