feat(api): POST /service-config/reset-defaults — replaces "reset to builtin" #937
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#937
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
As an operator, I want a "Reset to factory defaults" button on the service-config dashboard that re-applies the code-level defaults, so that the workflow stops depending on a
scope='builtin'row that the runtime no longer needs.Today
apps/web/src/routes/$locale/settings.service.tsxshows two reset affordances ("Fields reset to builtin" / "All global overrides reset to builtin") that both rely on a builtin DB row to exist. After tracker #934 lands, builtin rows are gone andSERVICE_CONFIG_DEFAULTSis the only source of factory truth — the endpoint must reflect that.Acceptance criteria
API
POST /api/service-config/reset-defaults(admin-gated, same auth as the existing service-config PUT) overwrites thescope='global'service_configrow with values fromSERVICE_CONFIG_DEFAULTS. UPSERT semantics: insert if missing.fields?: string[]— when provided, only those columns are reset; otherwise every default-bearing column is reset.config_revisionrow withkind='service_config',comment='reset to factory defaults',body_snapshotcarrying the prior row.service_configrow in the response body so the dashboard can refresh without a separate GET.Tests
'reset to factory defaults'revision.fields: ['watchdogs_json']) only touches the requested columns.Wiring
apps/server/src/main.tsunder the existing service-config router.apps/web/src/lib/api.tsexportspostServiceConfigReset(fields?: string[]).Out of scope
References
service-config defaults to code constantsstory landing first.apps/web/src/routes/$locale/settings.service.tsx:82,:91,:182