Persist deployment-page monitoring fields end-to-end (payload size/unit, metrics interval, replay, route control) #148
Reference in New Issue
Block a user
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?
Context
Surfaced during manual QA of the unified app deployment page (spec:
docs/superpowers/specs/2026-04-22-app-deployment-page-design.md, plan:docs/superpowers/plans/2026-04-22-app-deployment-page.md).The Monitoring tab on
/apps/:slugrenders five controls that the oldCreateAppViewalso rendered but never persisted:These are currently UI-only: they mount with sensible defaults (
payloadSize='4',payloadUnit='KB',metricsInterval='60',replayEnabled=true,routeControlEnabled=true) but are not written to theApplicationConfigDTO on Save and are not read back on load. The Javacom.cameleer.common.model.ApplicationConfigmodel does not carry these fields, and the agent SSE protocol does not consume them. The pre-existingCreateAppViewhad the same gap — we are not regressing prior behavior, only surfacing it.The user has stated these controls must be configurable during deployment and must affect agent behavior. Fixing this requires coordinated work across this server and the agent repo.
Scope
1.
cameleer-common(shared model)Add the five fields to
ApplicationConfig:Recommend collapsing
payloadSize+payloadUnitinto a single bytes integer on the wire — the UI already does the unit conversion in the old code. Keep the UI as two inputs; serialize as one.Consider whether
payloadCaptureMaxSizeneeds anulldefault (meaning "use agent-side default") or a hard default. Existing field style (e.g.samplingRatealways has a value) suggests hard defaults — document them inPROTOCOL.md.2.
cameleer-server(this repo)X-Cameleer-Protocol-Versionsemantics — we're currently on1).ApplicationConfigController.defaultConfigto seed the new fields.deployed_config_snapshotJSONB via the existingDeploymentConfigSnapshotrecord — these should participate in dirty detection. (DirtyStateCalculatoralready diffs agent config, so this is automatic once the fields are onApplicationConfig.)GET → PUT → GETround-trips the 5 fields; snapshot captures them; dirty-state detects changes to any of the 5.3.
cameleer-serverUIWire the existing UI form state to the ApplicationConfig body:
ui/src/pages/AppsTab/AppDeploymentPage/hooks/useDeploymentPageState.ts— read fromagentConfiginstead of using UI-only defaults.ui/src/pages/AppsTab/AppDeploymentPage/index.tsx— inhandleSave, sendpayloadCaptureMaxSize,metricsIntervalSeconds,replayEnabled,routeControlEnabled.schema.d.tsafter backend changes.4.
cameleer(agent repo)ApplicationConfigparsing on the agent side.payloadCaptureMaxSize— already exists? If yes, read from config. If not, add to payload capture code path.metricsIntervalSeconds— scheduler interval for the metrics reporter.replayEnabled— gate the replay command handler (rejectREPLAYcommands when disabled).routeControlEnabled— gate the route start/stop command handlers.PROTOCOL.md.5. Migration / compatibility
Existing deployed apps have no values for these fields. On first config read, the server should inject defaults into the response so the UI always shows something. Existing agents running protocol v1 without these fields should keep working (fields are additive and nullable on the wire).
Acceptance criteria
/apps/new, each of the 5 controls round-trips: enter a value, Save, navigate away, come back — the value persists.replayEnabled=false→ attempt a replay command → agent rejects it.routeControlEnabled=false→ attempt route start/stop → agent rejects it.metricsIntervalSeconds=30→ verify the agent emits metrics every ~30s.payloadCaptureMaxSize=1024→ verify payloads over 1 KiB are truncated.Redeploy.Not in scope
References
ui/src/pages/AppsTab/AppDeploymentPage/ConfigTabs/MonitoringTab.tsx— current (UI-only) implementation.ui/src/pages/AppsTab/AppDeploymentPage/hooks/useDeploymentPageState.ts— where the five fields currently live as client-only state.