Skip to content

bug: Connections (API keys) become permanently invalid after every cptr run restart due to JWT secret regeneration #227

Description

@utonez

Description

Every time cptr run is restarted, all previously configured Connections (including their encrypted API keys) become permanently unusable. Attempting to view, edit, verify, or even delete the affected connections triggers a 500 Internal Server Error, and the model list becomes empty ("沒有可用模型" / "No available models").

Steps to Reproduce

  1. Run cptr run and complete initial setup.
  2. Go to Settings → Connections, add a new connection (e.g. Ollama, http://<host>:11434), fill in API key, verify successfully, save.
  3. Confirm the model list populates correctly and the connection works as expected.
  4. Stop the process (Ctrl+C) and run cptr run again.
  5. Open the same workspace. The model list is now empty.
  6. Open the previously working connection under Settings → Connections and click "Verify" or just reload the Connections page.

Expected Behavior

Connections and their encrypted credentials should persist across restarts, as long as the workspace directory (and its .cptr/ folder) has not been deleted.

Actual Behavior

  • Model dropdown shows "No available models".
  • Opening the connections list triggers backend errors.
  • Server-side log shows:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions