Skip to content

tech-debt(memory): the lifecycle proxy's failure causes are bare strings about to become a frontend contract #14888

Description

@mrveiss

Summary

autobot-slm-backend/api/memory_lifecycle_proxy.py reports why a node could not be read using bare string literals:

node_unreachable · node_timeout · node_status_<code> · node_bad_payload · node_url_not_configured · internal_api_key_not_configured

These are deliberately distinct — 403 means the key is wrong, 404 means the node predates #12631, a timeout means alive but slow, and an operator acts differently on each. That design is right; the representation is weak.

Why now rather than later

#12632's frontend half has to switch on these values to show a useful cause instead of a generic error, and the handoff comment on that issue lists them as the contract. The moment that lands, a typo in either place produces a UI that silently falls through to a default branch — the failure mode being a monitoring surface that tells an operator less than it knows, which is what this whole area exists to fix.

Right now the strings exist in exactly one place and nothing consumes them, so this is the cheapest it will ever be to make explicit.

Work

  • Give the causes a named enum on the SLM side
  • Generate or mirror it for the frontend rather than hand-typing the strings a second time
  • Keep node_status_<code> composable — the status code is data, not a separate cause
  • Guard it: a test asserting every cause the proxy can emit is one the consumer handles

Acceptance

A cause the proxy can return and the tab cannot render fails a test rather than rendering as "unknown error".

Related: #12632, #14653.

Activity

  1. modified the milestones: Backlog, v0.12.0 on Sep 12, 2026
  2. mrveiss commented on Oct 2, 2026

    @mrveiss
    OwnerAuthor

    Remaining scope, measured 2026-10-03 against origin/main: blocked on #12632

    Done already: the failure causes are named constants in autobot_shared/node_proxy.py (REASON_KEY_NOT_CONFIGURED, REASON_URL_NOT_CONFIGURED, REASON_TIMEOUT, REASON_UNREACHABLE), and memory_lifecycle_proxy.py emits them. node_status_<code> is still composed inline (memory_lifecycle_proxy.py:108).

    Not done, and cannot be done yet: there is no frontend consumer. No component, composable or API helper in autobot-slm-frontend/src calls /api/memory/lifecycle. The only references are the generated api.ts types. Searched by API path, by operation id (get_memory_lifecycle) and by /memory/ route strings, with no hits outside generated types. The tab that would consume these causes is #12632's MemoryLifecycleTab, still open.

    So the work items split:

    Recorded as blocked_by #12632. When the tab lands, enum + mirror + guard ship together, so the strings never become a hand-typed contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions