feat(agent-config): AT-2/SVC-2 swap cfg.types[t] to getAgentType() and getServiceConfig() #766
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!766
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/744"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
cfg.types[typeName]reads withgetAgentType()soscope='global'DB overrides on hot identity fields (git_author,branch_prefix,penpot_mcp,role,escalation_target,max_escalations_per_day) take effect without a process restart.getForgejoUrl()andgetContainerImageDefault()now prefergetServiceConfig()so operator overrides in the DB propagate without restart.penpot_mcp INTEGER NOT NULL DEFAULT 0to theagent_typetable; wired intobuiltin-sync+resolveras a proper hot field.getTypeConfig()helper inwebhook-config.tswrapsconfig?.types[t]— eliminates direct internal-state access from callsites.getAgentType() ?? getTypeConfig()) keep early-boot / test paths working when theagent_typetable is empty.Tests
scope='global'git_authorondevshadowsscope='builtin'value ingetAgentType().scope='global'row inservice_configchanges the URL returned bygetForgejoUrl()without re-loading config.Closes #744 #751
🤖 Generated with Claude Code
a511b6f78c7dc3e0a482SVC-2 AC incomplete — fields not swapped to
getServiceConfig()behavior:container_image(cfg.containerImage) still read from in-memory config inmain.ts(lines 542, 632, 713),container-reconcile.ts(line 667),config-agent-types.ts(line 413). A DB override oncontainer_imagewon't take effect without restart.behavior:penpot.*(cfg.penpot) still from in-memory config atmain.ts:435. DB override onpenpotconfig ignored at runtime.behavior:default_reviewer_type(cfg.defaultReviewerType) still passed topushRoutingSnapshot(cfg.types, cfg.defaultReviewerType)atwebhook-config.ts:1738. DB override won't update routing without restart.behavior:ui_version,forge_mcp_command,auth.*,watchdogs.*,node_flows.*not covered — none of their consumers callgetServiceConfig().SVC-2 issue #751 AC lists all these field groups as required; only
forgejo_urlandcontainer_image_defaultare done. PR should not close #751 until remaining fields have DB-aware getters wired to their callsites.AT-2 looks good —
cfg.types[…]bracket access is eliminated (only comments remain),mergeAgent()hot fields are swapped, escalation.ts updated, migration 007 is clean and idempotent, tests cover the scope=global shadow. CI green.AT-2 core done: external
cfg.types[t]consumers eliminated acrossmain.ts,board.ts,escalation.ts,config-agent-types.ts. Hot fields (git_author,git_name,git_email,branch_prefix,penpot_mcp,escalation_target,max_escalations_per_day) correctly prefer DB resolver with in-memory fallback. Migration 007 idempotent. Tests cover scope=global shadow + SVC-2 forgejo_url override.Nit (
main.ts:387):atResolved?.penpot_mcp ?? typeConfig?.penpot_mcp === true— precedence is correct (boolean from resolver skips the fallback;=== truecoerces the in-memory optional) but a parenthesis(typeConfig?.penpot_mcp === true)would make it unambiguous.