Skip to content

bug(config): rollback writes a revision row but never restores the live config #18478

Closed
2 of 2 issues completed

Description

@mrveiss

Problem

Config rollback records that a rollback happened but never restores the config. rollback_to_revision inserts a new ConfigRevision row with source="rollback" and returns. Nothing writes after_config back to the live settings store or the agent config. The UI's rollback button reports success while the running config is unchanged.

Location

What Where
Service only calls create_revision autobot-backend/services/config_revision_service.py rollback_to_revision (~L105-131)
Route autobot-backend/api/config_revisions.py POST /config-revisions/{entity_type}/{entity_id}/{revision_id}/rollback
Live writers never called services/config_service.py save_full_config; agent-config writer in api/agent_config.py
UI autobot-slm-frontend/src/components/agents/ConfigHistoryTab.vue

The feature was delivered under #1404 (closed). This is a defect in that delivery.

Change

  • Dispatch rollback by entity_type to the writer that owns the live config, then record the revision. If the apply fails, record nothing.
  • Unknown entity_type → 400, never a silent row.

Acceptance criteria

  • Rolling back a settings revision changes the value returned by the live settings read
  • Rolling back an agent-config revision changes the live agent config
  • A failed apply leaves no source="rollback" row
  • Regression test asserts the live store, not the revision table

Audited against origin/main @ df211d3ba6. Part of the server-admin patterns umbrella.


Research: docs/research/RES_server-admin-panel-patterns.md

Activity

  1. mrveiss commented on Oct 26, 2026

    @mrveiss
    OwnerAuthor

    Requirement for the restore this issue adds, found in code review on PR #19648 (#19337): stored revisions are redacted before they are written (config_revision_service.redact_secrets). So target.after_config holds placeholders, not secrets: ********** (REDACTED_PLACEHOLDER) from #19337 on, and ***REDACTED*** in older rows (LEGACY_PLACEHOLDERS in autobot_shared/secret_redaction.py). A restore that applies the snapshot as-is would write a placeholder over the live secret. When restoring, any value equal to REDACTED_PLACEHOLDER or in LEGACY_PLACEHOLDERS must keep the current live value, and that needs a test. Today the hazard is latent, because the rollback endpoint applies nothing (which is this issue).

  2. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 3, 2026
  3. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  4. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 12, 2026
  5. added
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 18, 2026
  6. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21743, merge ea542589c6) via #21741

  7. mrveiss commented on Nov 18, 2026

    @mrveiss
    OwnerAuthor

    ✅ Verified closed with proof of implementation

    Delivered by: PR #21741 (head ed0718758d), landed on main via train T144 (#21743), merge commit ea542589c6. Verified against origin/main.
    Chain: services/config_revision_service.py ConfigRevisionService.rollback_to_revision → services/config_rollback.py rollback_locked → apply_snapshot, applied before _record_applied_rollback writes the row.

    Acceptance criteria (quoted verbatim):

    • "Rolling back a settings revision changes the value returned by the live settings read" — ✅ apply_snapshot writes through ConfigService.save_full_config / update_backend_settings. Tests autobot-backend/services/config_rollback_18478_test.py::test_settings_rollback_changes_the_live_read, ::test_backend_rollback_changes_the_live_read.
    • "Rolling back an agent-config revision changes the live agent config" — ✅ agent target writes agents.<id>.* through config_manager.set_nested + save_settings. Tests ::test_agent_rollback_changes_the_live_agent_config, ::test_agent_write_failure_restores_prior_values.
    • "A failed apply leaves no source=\"rollback\" row" — ✅ apply runs first and raises before any row. Test ::test_failed_apply_records_no_rollback_row (asserts create_revision never called); unknown targets raise UnsupportedRollbackTarget (::test_unknown_target_is_rejected).
    • "Regression test asserts the live store, not the revision table" — ✅ the live fixture patches ConfigService.get_full_config/save_full_config/get_backend_settings/update_backend_settings with _LiveStore, and the tests above assert live.get_full_config() / live.get_backend_settings().

    Scope note: the tests exercise the service against a stand-in live store (unit level); no host-level evidence is claimed here.

  8. removed
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions