Skip to content

Commit 262370c

Browse files
hTrapclaude
andcommitted
fix: GetOwnerID returns DAO name instead of numeric group ID
When active DAO is set, create_repo failed with "owner id must consist minimum 3 chars" because GetOwnerID returned ActiveDAO.ID (the numeric cosmos group ID, e.g. "3") instead of ActiveDAO.Name (e.g. "Gitopia"). Fixes Gitopia/gitopia-mcp-server#1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 58892cd commit 262370c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/session/user_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (cm *ContextManager) GetOwnerID() string {
106106
}
107107

108108
if cm.context.ActiveDAO != nil {
109-
return cm.context.ActiveDAO.ID
109+
return cm.context.ActiveDAO.Name
110110
}
111111

112112
return cm.context.Username

internal/session/user_context_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestGetOwnerID_WithActiveDAO(t *testing.T) {
5454
DAOs: []DAO{dao},
5555
ActiveDAO: &dao,
5656
})
57-
assert.Equal(t, "dao-123", cm.GetOwnerID())
57+
assert.Equal(t, "myorg", cm.GetOwnerID())
5858
}
5959

6060
func TestGetUsername_NilContext(t *testing.T) {

0 commit comments

Comments
 (0)