Skip to content

[P0.2] Stop react_agent from initializing the control-plane DB (and seeding an admin user) into the workspace DB #713

Description

@frankbria

Severity: medium | Category: data-integrity | Phase: P0.2

Problem

_persist_token_usage does Database(self.workspace.db_path); db.initialize(), which runs SchemaManager.create_schema() — creating control-plane tables (users, api_keys, sessions, audit_logs) and inserting admin@localhost into every per-workspace state.db. This pollutes the domain DB with auth tables and is the mechanism that hid P0.1 (initialize "succeeds" without ever creating token_usage).

Evidence

codeframe/core/react_agent.py:358

Acceptance criteria

  • Token usage persists through the per-workspace connection/schema, not the control-plane Database.
  • A workspace DB after an agent run contains no users/api_keys/sessions tables and no admin row.

Dependencies

blocked by #712 ([P0.1])


Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0-blocker-betaCritical blocker - must fix before beta testingpriority:mediumtype:bugSomething is broken and needs fixing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions