[GH-ISSUE #1788] [Issue]: Connections parity regressions in credentials, folders, and provider metadata #870

Closed
opened 2026-10-21 05:22:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1788

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The refactor Connections feature has several parity regressions from the legacy Connections implementation. The highest-risk gap is credential handling: connection API keys now flow through generic storage as plain apiKey records, while legacy encrypted stored keys and masked normal reads.

Secondary regressions affect connection folder lifecycle behavior, provider model metadata, Claude routing diagnosis UX, and ComfyUI reference-image placeholder guidance.

Expected behavior

  • Connection secrets are encrypted at rest, masked in normal reads, and only decrypted inside trusted runtime paths that need them.
  • Legacy imported connection credentials either keep working through migration/decryption or fail with explicit migration guidance.
  • Connection folders preserve owner behavior: default fields, folder existence validation, child-connection unfile on folder delete, and atomic reorder/move operations.
  • Provider model fetch preserves remote model metadata such as context and maxOutput, and the editor applies those values when selecting fetched models.
  • Claude routing diagnosis should not present a successful/green result when usage metadata indicates a silent downgrade or different billed model.
  • ComfyUI workflow validation/help should document the filename reference placeholders already supported by the runtime.

Actual behavior

  • Refactor schemas/hooks/runtime paths use plain apiKey storage and reads:
    • src/engine/contracts/schemas/connection.schema.ts
    • src/features/catalog/connections/hooks/use-connections.ts
    • src-tauri/src/commands/storage/llm.rs
    • src-tauri/src/commands/storage/prompts.rs
  • Legacy used encrypted key storage plus masked list/detail responses:
    • packages/server/src/utils/crypto.ts
    • packages/server/src/services/storage/connections.storage.ts
    • packages/server/src/routes/connections.routes.ts
  • Refactor connection folder hooks call generic storage directly, so folder defaults, delete-unfile behavior, validation, and transactional reorder/move behavior are absent:
    • src/features/catalog/connections/hooks/use-connection-folders.ts
    • src-tauri/crates/storage/src/lib.rs
  • Legacy folder storage owned those behaviors:
    • packages/server/src/services/storage/connection-folders.storage.ts
    • packages/server/src/routes/connection-folders.routes.ts
  • Refactor OpenAI-compatible model normalization returns only basic id/name/provider fields, and the editor de-dupes fetched models behind the static known-model list:
    • src-tauri/src/commands/storage/llm.rs
    • src/features/shell/connections/components/ConnectionEditor.tsx
  • Legacy preserved remote model limits and used fetched models to set context/max-token behavior:
    • packages/server/src/routes/connections.routes.ts
    • packages/client/src/components/connections/ConnectionEditor.tsx

Steps to reproduce

Static code-path reproduction from the current refactor branch:

  1. Inspect connection create/update schema, connection hooks, and Rust LLM/prompt command paths. Observe that apiKey is stored/read directly, with no equivalent encrypted field or decrypt-on-use path.
  2. Inspect connection folder create/delete/move/reorder hooks. Observe direct generic storage calls instead of owner commands that validate folders, unfile children on delete, and perform atomic reorder/move.
  3. Inspect OpenAI-compatible model fetch normalization and editor model merge behavior. Observe that fetched provider limits are not preserved into the selected model info or max-token override behavior.
  4. Inspect Claude routing diagnosis rendering. Observe that success={claudeDiagResult.success} can render success while a downgrade warning is also shown.
  5. Inspect ComfyUI workflow validation/help. Observe that filename placeholder variants such as %reference_image_name% are supported by the runtime but missing from editor validation/help text.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: origin/refactor at 6cc9d086
  • Run mode: Static code inspection only; Tauri desktop behavior not manually exercised
  • OS + version: Not relevant
  • Node + pnpm versions: Not run
  • Rust version, if relevant: Not run
  • Remote Runtime URL configured? Not relevant
  • Provider, model, or integration, if relevant: Connections, OpenAI-compatible providers, Claude subscription routing, ComfyUI workflows

Logs, screenshots, or video

No logs or screenshots. This came from static parity comparison against the legacy implementation. No secrets or API keys were inspected.

Regression notes

Legacy behavior had dedicated server-side storage/routes for connection credentials and connection folders. The refactor appears to have moved these paths onto generic storage without carrying over several owner-specific behaviors.

The Local Model sidecar workflow also differs: legacy exposed a built-in Local Model card under Connections, while refactor code appears to retire sidecar embeddings and require normal embedding-capable connections. That may be intentional, but it needs either a port decision or explicit import/discovery guidance.

Additional context

Suggested fix order:

  1. Restore secure credential handling first, including encrypted-at-rest storage, masked normal reads, decrypt-on-use runtime access, and legacy import migration behavior.
  2. Add focused connection-folder owner commands/API wrappers for create/delete/move/reorder instead of raw generic storage calls.
  3. Restore provider model metadata through Rust normalization, shared API types, and editor selection behavior.
  4. Adjust Claude diagnosis result semantics so downgraded/different billed model states are warning/failure states, not plain success.
  5. Update ComfyUI placeholder validation/help for %reference_image_name% and indexed filename variants.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1788 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The refactor Connections feature has several parity regressions from the legacy Connections implementation. The highest-risk gap is credential handling: connection API keys now flow through generic storage as plain `apiKey` records, while legacy encrypted stored keys and masked normal reads. Secondary regressions affect connection folder lifecycle behavior, provider model metadata, Claude routing diagnosis UX, and ComfyUI reference-image placeholder guidance. ## Expected behavior - Connection secrets are encrypted at rest, masked in normal reads, and only decrypted inside trusted runtime paths that need them. - Legacy imported connection credentials either keep working through migration/decryption or fail with explicit migration guidance. - Connection folders preserve owner behavior: default fields, folder existence validation, child-connection unfile on folder delete, and atomic reorder/move operations. - Provider model fetch preserves remote model metadata such as `context` and `maxOutput`, and the editor applies those values when selecting fetched models. - Claude routing diagnosis should not present a successful/green result when usage metadata indicates a silent downgrade or different billed model. - ComfyUI workflow validation/help should document the filename reference placeholders already supported by the runtime. ## Actual behavior - Refactor schemas/hooks/runtime paths use plain `apiKey` storage and reads: - `src/engine/contracts/schemas/connection.schema.ts` - `src/features/catalog/connections/hooks/use-connections.ts` - `src-tauri/src/commands/storage/llm.rs` - `src-tauri/src/commands/storage/prompts.rs` - Legacy used encrypted key storage plus masked list/detail responses: - `packages/server/src/utils/crypto.ts` - `packages/server/src/services/storage/connections.storage.ts` - `packages/server/src/routes/connections.routes.ts` - Refactor connection folder hooks call generic storage directly, so folder defaults, delete-unfile behavior, validation, and transactional reorder/move behavior are absent: - `src/features/catalog/connections/hooks/use-connection-folders.ts` - `src-tauri/crates/storage/src/lib.rs` - Legacy folder storage owned those behaviors: - `packages/server/src/services/storage/connection-folders.storage.ts` - `packages/server/src/routes/connection-folders.routes.ts` - Refactor OpenAI-compatible model normalization returns only basic id/name/provider fields, and the editor de-dupes fetched models behind the static known-model list: - `src-tauri/src/commands/storage/llm.rs` - `src/features/shell/connections/components/ConnectionEditor.tsx` - Legacy preserved remote model limits and used fetched models to set context/max-token behavior: - `packages/server/src/routes/connections.routes.ts` - `packages/client/src/components/connections/ConnectionEditor.tsx` ## Steps to reproduce Static code-path reproduction from the current refactor branch: 1. Inspect connection create/update schema, connection hooks, and Rust LLM/prompt command paths. Observe that `apiKey` is stored/read directly, with no equivalent encrypted field or decrypt-on-use path. 2. Inspect connection folder create/delete/move/reorder hooks. Observe direct generic storage calls instead of owner commands that validate folders, unfile children on delete, and perform atomic reorder/move. 3. Inspect OpenAI-compatible model fetch normalization and editor model merge behavior. Observe that fetched provider limits are not preserved into the selected model info or max-token override behavior. 4. Inspect Claude routing diagnosis rendering. Observe that `success={claudeDiagResult.success}` can render success while a downgrade warning is also shown. 5. Inspect ComfyUI workflow validation/help. Observe that filename placeholder variants such as `%reference_image_name%` are supported by the runtime but missing from editor validation/help text. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor` at `6cc9d086` - Run mode: Static code inspection only; Tauri desktop behavior not manually exercised - OS + version: Not relevant - Node + pnpm versions: Not run - Rust version, if relevant: Not run - Remote Runtime URL configured? Not relevant - Provider, model, or integration, if relevant: Connections, OpenAI-compatible providers, Claude subscription routing, ComfyUI workflows ## Logs, screenshots, or video No logs or screenshots. This came from static parity comparison against the legacy implementation. No secrets or API keys were inspected. ## Regression notes Legacy behavior had dedicated server-side storage/routes for connection credentials and connection folders. The refactor appears to have moved these paths onto generic storage without carrying over several owner-specific behaviors. The Local Model sidecar workflow also differs: legacy exposed a built-in Local Model card under Connections, while refactor code appears to retire sidecar embeddings and require normal embedding-capable connections. That may be intentional, but it needs either a port decision or explicit import/discovery guidance. ## Additional context Suggested fix order: 1. Restore secure credential handling first, including encrypted-at-rest storage, masked normal reads, decrypt-on-use runtime access, and legacy import migration behavior. 2. Add focused connection-folder owner commands/API wrappers for create/delete/move/reorder instead of raw generic storage calls. 3. Restore provider model metadata through Rust normalization, shared API types, and editor selection behavior. 4. Adjust Claude diagnosis result semantics so downgraded/different billed model states are warning/failure states, not plain success. 5. Update ComfyUI placeholder validation/help for `%reference_image_name%` and indexed filename variants. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:22:40 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Jun 1, 2026):

Fixed on refactor in c887d704.\n\nWhat changed:\n- connection API keys now go through a dedicated secret path: generic reads are masked, storage writes encrypt keys at rest, trusted runtime/model/image/embedding paths decrypt explicitly, and legacy plaintext keys migrate on runtime use with a clear re-entry error if decryption fails.\n- profile export/import now exports connection keys in a portable form and re-encrypts them on import under the target install key.\n- connection folders now get native defaults/validation, server-side move/reorder commands, and folder deletion unfiles child connections.\n- provider model fetches preserve remote context/max output metadata; fetched models are no longer hidden behind static duplicates, and selection applies those limits.\n- Claude subscription routing diagnosis now reports downgrade/different billed model as unsuccessful instead of green.\n- ComfyUI workflow help/validation documents %reference_image_name% and indexed reference filename placeholders.\n\nVerified:\n- pnpm typecheck\n- pnpm check:architecture\n- cargo check --manifest-path src-tauri/Cargo.toml\n- cargo test --manifest-path src-tauri/Cargo.toml connection_\n- cargo test --manifest-path src-tauri/Cargo.toml openai_compatible_model_metadata_preserves_context_and_output_limits\n- cargo test --manifest-path src-tauri/Cargo.toml profile_export_import_preserves_connection_folders\n- git diff --check

<!-- gh-comment-id:4591693891 --> @SpicyMarinara commented on GitHub (Jun 1, 2026): Fixed on refactor in c887d704.\n\nWhat changed:\n- connection API keys now go through a dedicated secret path: generic reads are masked, storage writes encrypt keys at rest, trusted runtime/model/image/embedding paths decrypt explicitly, and legacy plaintext keys migrate on runtime use with a clear re-entry error if decryption fails.\n- profile export/import now exports connection keys in a portable form and re-encrypts them on import under the target install key.\n- connection folders now get native defaults/validation, server-side move/reorder commands, and folder deletion unfiles child connections.\n- provider model fetches preserve remote context/max output metadata; fetched models are no longer hidden behind static duplicates, and selection applies those limits.\n- Claude subscription routing diagnosis now reports downgrade/different billed model as unsuccessful instead of green.\n- ComfyUI workflow help/validation documents %reference_image_name% and indexed reference filename placeholders.\n\nVerified:\n- pnpm typecheck\n- pnpm check:architecture\n- cargo check --manifest-path src-tauri/Cargo.toml\n- cargo test --manifest-path src-tauri/Cargo.toml connection_\n- cargo test --manifest-path src-tauri/Cargo.toml openai_compatible_model_metadata_preserves_context_and_output_limits\n- cargo test --manifest-path src-tauri/Cargo.toml profile_export_import_preserves_connection_folders\n- git diff --check
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#870
No description provided.