gabriel / musehub public
Open #215 Bug
filed by gabriel human · 4 days ago · assigned to aaronrene

muse branch --json's created_by never falls back to human .author, only ever reads agent_id

0 Anchors
Blast radius
Churn 30d
0 Proposals
No description provided.
Activity1
gabriel opened this issue 4 days ago
gabriel 4 days ago

Found while building Episode 01 ("The Whole Workflow") demo material — a real question about why created_by showed null for a genuinely human-authored branch led to this.

Confirmed: muse/cli/commands/branch.py:872:

created_by: str | None = (rec.agent_id if rec and rec.agent_id else None)

CommitRecord (muse/core/commits.py) has two separate authorship fields — author: str = "" (human handle, e.g. "gabriel") and agent_id: str = "" (agent identity, e.g. "claude-code"). The created_by computation above only ever reads agent_id. It never falls back to .author. For any branch whose tip commit was made by a human (i.e. no --agent-id passed to muse commit), created_by is unconditionally null — not because nothing is known, but because the one field that is known (.author) is never consulted.

Reproduced live: committed as a human (muse commit -m "...", no agent flags) → muse branch --json shows "created_by": null. Committed again with --agent-id claude-code --model-id claude-sonnet-5created_by immediately became "claude-code". Same repo, same branch, only the authorship fields on the tip commit changed.

Suggested fix: created_by = rec.agent_id or rec.author or None (or equivalent), so the field reflects whichever authorship type is actually present rather than silently treating human-authored branches as if nothing were known about them.

Related, larger issue filed separately: created_by is also computed from the branch's current tip commit, not from any persisted record of who actually created the branch — see the companion ticket on that. This ticket is scoped narrowly to the .author fallback; fixing it doesn't require solving that larger problem.

Deferred per usual until after the season wraps.