fix: add external_ref support to daemon mode RPC (fixes #303) (#304)

Add external_ref field to CreateArgs and UpdateArgs RPC protocol
structs to enable linking issues to external systems (GitHub, Jira,
Shortcut, etc.) when using daemon mode.

Changes:
- Add ExternalRef field to rpc.CreateArgs and rpc.UpdateArgs
- Update bd create/update commands to pass external_ref via RPC
- Update daemon handlers to process external_ref field
- Add integration tests for create and update operations

The --external-ref flag now works correctly in both daemon and direct modes.

Fixes https://github.com/steveyegge/beads/issues/303

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
This commit is contained in:
David Laing
2025-11-13 20:01:27 +00:00
committed by GitHub
parent 0cba73bfc6
commit 57b6ea606b
5 changed files with 263 additions and 127 deletions

View File

@@ -66,6 +66,9 @@ func updatesFromArgs(a UpdateArgs) map[string]interface{} {
if a.Assignee != nil {
u["assignee"] = *a.Assignee
}
if a.ExternalRef != nil {
u["external_ref"] = *a.ExternalRef
}
return u
}
@@ -108,7 +111,7 @@ func (s *Server) handleCreate(req *Request) Response {
issueID = childID
}
var design, acceptance, assignee *string
var design, acceptance, assignee, externalRef *string
if createArgs.Design != "" {
design = &createArgs.Design
}
@@ -118,6 +121,9 @@ func (s *Server) handleCreate(req *Request) Response {
if createArgs.Assignee != "" {
assignee = &createArgs.Assignee
}
if createArgs.ExternalRef != "" {
externalRef = &createArgs.ExternalRef
}
issue := &types.Issue{
ID: issueID,
@@ -128,6 +134,7 @@ func (s *Server) handleCreate(req *Request) Response {
Design: strValue(design),
AcceptanceCriteria: strValue(acceptance),
Assignee: strValue(assignee),
ExternalRef: externalRef,
Status: types.StatusOpen,
}