Consolidate mirrored agent-type/ide-type tables into shared modules - #849
Merged
Conversation
AGENT_TYPES, CLI_AGENT_TYPES, and their predicates/sanitizers were duplicated verbatim between apps/server/src/agent-type-settings.ts and apps/web/src/lib/agent-types.ts; same for IDE_TYPES between apps/server/src/ide-settings.ts and apps/web/src/lib/ide-types.ts. Adding an agent type meant editing both copies. Move the pure constants and predicates into dependency-free apps/server/src/shared/agent-types.ts and shared/ide-types.ts, following the media-file-types.ts shape from #844: the server settings modules re-export so their importers are untouched, and the web lib modules re-export across the workspace boundary so web importers keep their "@/lib/..." specifiers. Pool-dependent getters stay on the server; display labels and web-only helpers stay in web. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 30, 2026
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.
What
Moves the agent-type and IDE-type constants/predicates that were duplicated verbatim across the server/web boundary into two new dependency-free shared modules:
apps/server/src/shared/agent-types.ts—AGENT_TYPES,CLI_AGENT_TYPES,isAgentType,isCliAgentType,sanitizeEnabledAgentTypesapps/server/src/shared/ide-types.ts—IDE_TYPES,isIdeType,sanitizeEnabledIdesapps/server/src/agent-type-settings.tsandide-settings.tskeep their Pool-dependent getters and re-export the pure symbols, so no server importer changes.apps/web/src/lib/agent-types.tsandide-types.tsre-export across the workspace boundary (same shape asmedia-file-types.tsfrom #844) and keep the web-only labels/helpers (AGENT_TYPE_LABELS,sortAgentTypes,isNestedReviewAgent,IDE_LABELS), so no web importer changes either.Why it's tech debt
Adding an agent type today means editing two identical tables that have already started to drift in small ways (predicate signatures, comment wording). Same failure mode that produced the media file-type bugs fixed in #844.
Zero behavior change: only widening of
isAgentType/isCliAgentTypeweb signatures from(value: string)to(value: unknown), which is safe for all callers.Validation
pnpm run check✅pnpm run finalize:web✅pnpm run test— 2362 server + 499 web + 60 passed ✅pnpm run test:e2e— 174 passed, 12 skipped ✅Queued next
Top of the tech-debt backlog: deduplicating the verbatim server↔web wire types (
JobRecord/Job,TemplateRecord/Template,ReleaseJob), one file at a time.🤖 Generated with Claude Code