fix(update): use IsValidWithCustom for --type validation#1356
Merged
steveyegge merged 1 commit intosteveyegge:mainfrom Jan 27, 2026
Merged
fix(update): use IsValidWithCustom for --type validation#1356steveyegge merged 1 commit intosteveyegge:mainfrom
steveyegge merged 1 commit intosteveyegge:mainfrom
Conversation
bd update --type rejected custom types (agent, role, etc.) because it called IsValid() which only checks built-in types. Now loads custom types from config and calls IsValidWithCustom(), matching the pattern used in the storage layer (PR steveyegge#1322). Also fixes the error message to dynamically list valid types from config instead of hardcoding them.
steveyegge
approved these changes
Jan 27, 2026
Owner
steveyegge
left a comment
There was a problem hiding this comment.
LGTM - good fix using existing IsValidWithCustom() pattern. Clean change, well-documented audit of other call sites. Lint failure is pre-existing on main.
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
…1356) bd update --type rejected custom types (agent, role, etc.) because it called IsValid() which only checks built-in types. Now loads custom types from config and calls IsValidWithCustom(), matching the pattern used in the storage layer (PR steveyegge#1322). Also fixes the error message to dynamically list valid types from config instead of hardcoding them.
groblegark
pushed a commit
to groblegark/beads
that referenced
this pull request
Jan 31, 2026
…1356) bd update --type rejected custom types (agent, role, etc.) because it called IsValid() which only checks built-in types. Now loads custom types from config and calls IsValidWithCustom(), matching the pattern used in the storage layer (PR steveyegge#1322). Also fixes the error message to dynamically list valid types from config instead of hardcoding them.
PabloLION
added a commit
to PabloLION/beads
that referenced
this pull request
Feb 4, 2026
When daemon is running, `store` is nil (by design - daemon owns the database). PR steveyegge#1356 added custom type validation using `store.GetCustomTypes()` but this returns empty in daemon mode, causing validation to reject all custom types. Add fallback to `config.GetCustomTypesFromYAML()` when store is nil, following the same pattern already used in the storage layer. Fixes: steveyegge#1499 Co-Authored-By: Claude Opus 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bd update --type=agent(and other custom types) fails with:The error message lists custom types as valid, but the validator rejects them anyway.
Root Cause
When Gas Town types were moved from core to
types.customconfig,cmd/bd/update.gowas not updated. It still callsIsValid()(line 116), which only checks the 5 built-in types (bug, feature, task, epic, chore). The storage layer was fixed in PR #1322, but the CLI-level validation was missed.The error message at line 117 was also left hardcoded with the old list, creating the confusing situation where the error tells you a type is valid while simultaneously rejecting it.
Fix
GetCustomTypes()IsValid()withIsValidWithCustom(customTypes)This follows the same pattern used in the storage layer fix (PR #1322).
Scope Check
Audited all
.IsValid()calls incmd/bd/to confirm this is the only affected site:update.go:116IssueTypelist.go:600MolTypecreate.go:130MolTypeready.go:60MolTypeready.go:104SortPolicycreate_form.go:183DependencyTypecreate.go:680DependencyTypemarkdown.go:393DependencyTypedoctor/deep.go:339AgentStateOnly
IssueTypehas the custom types extension mechanism (IsValidWithCustom). The other types are fixed enums. Issue #1002 covers a similar problem inbd createbut that's a separate code path.Impact
Without this fix,
bd update --type=<custom>is broken for all custom types. This blocks workflows that need to change issue types to agent, role, rig, convoy, etc. — for example, fixing beads that were created astaskbut should beagent.Testing
TestExportToJSONLWithStore_IncludesTombstones, unrelated)🤖 Tackled with Claude Code