fix(plugins): retain MCP drafts until connection succeeds (v5.0 backport)

Merged
WE
4h ago
+1111-619

Description

Keep MCP setup and connection edits unsaved until validation succeeds. Preserve drafts after in-form failures and capture OAuth setup responses before browser navigation in tests.

Manual cherry-pick of #16419 from main (d942a6d4570ede218c90aacde2c66ed27c20daf8). The original stack merged on main; its automatic release backport did not run. This cherry-pick applied without code changes.

Builds on https://github.com/onyx-dot-app/onyx/pull/16453. Merge this stack from bottom to top into release/v5.0.

How Has This Been Tested?

Validated the complete backport stack on release/v5.0:

  • 202 frontend component tests passed across MCP configuration, authentication, setup, default Chat, and OpenAPI plugins.
  • 353 backend MCP, route-contract, and OpenAPI availability tests passed.
  • Changed-file pre-commit checks passed, including Python and TypeScript typing, coverage, lint, formatting, translations, and feature-map integrity.
  • PostgreSQL setup and locking tests could not start: local PostgreSQL refused connections on port 5432.
  • Live provider OAuth was not rerun locally. Release CI will run on this PR.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.

Summary by cubic

Manual backport of #16419 to v5.0 that keeps MCP setup and connection edits unsaved until authentication and tool discovery succeed. Applied without code changes.

  • Failed or cancelled authentication no longer overwrites saved settings; in-form failures retain drafts.
  • Setup now publishes server, auth, and tool configuration in a single staged call only after connection validation succeeds.
  • OAuth provider denials consume the staged attempt and keep the cancelled screen.
  • E2E helpers capture the staged setup response and read the saved server ID after OAuth completes.