Skip to content

refactor(storage): remove the leftover llm-connections.json store - #3117

Merged
Astro-Han merged 4 commits into
apache:mainfrom
1625567290:fix/storage-remove-llm-connections-store
Aug 16, 2026
Merged

refactor(storage): remove the leftover llm-connections.json store#3117
Astro-Han merged 4 commits into
apache:mainfrom
1625567290:fix/storage-remove-llm-connections-store

Conversation

@1625567290

Copy link
Copy Markdown
Contributor

Summary

Connection catalog authority already lives in Runtime Policy (connection-catalog.json). FileConnectionStore still wrote a second file, llm-connections.json, that Host never reads.

This PR removes that leftover store:

  • Delete connection-store.ts, relay-profile-store.ts, their tests, and the ./connection-store export
  • Desktop e2e writeConnections now creates catalog rows through openInteractiveRuntimePolicyStoresForWrite
  • scripts/computer-use/real-model.mjs copies or seeds connection-catalog.json + the credential vault instead of llm-connections.json
  • README / README.zh-CN list connection-catalog.json as the current layout

Existing user llm-connections.json files stay on disk as inert data. Maka does not import them.

Fixes #3107

Verification

  • Grep: no remaining production reader/writer of llm-connections.json (archive walkthrough only)
  • npx biome check on the changed source files — clean
  • npm --workspace @maka/storage run typecheck — clean
  • Official npm --workspace @maka/storage run test:dist778 pass / 1 fail / 14 skip. The failure is rejects a second authority for the same storage root in another process in managed-dependency-environment-crash. Isolated rerun still flakes; not this change
  • npm --workspace @maka/desktop run typecheck — clean
  • New catalog fixture test — 1/1
  • Official npm --workspace @maka/desktop run test:dist863/863

Not run: full desktop e2e suite; Computer Use live real-model script

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:

Grok authored the deletion, fixture/script rewrite, and this PR description.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@1625567290, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Limit details: You’ve used all 3 included reviews currently available under your plan.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 820e237b-86bd-401e-9e7e-c7c8763981e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7a0ca28 and 7de59f4.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/locales/plan-mode-copy.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e448ab9-5d45-404d-961c-f6c904e4efe0

📥 Commits

Reviewing files that changed from the base of the PR and between e89f5a2 and 7a0ca28.

📒 Files selected for processing (8)
  • README.md
  • README.zh-CN.md
  • apps/desktop/src/main/__tests__/connection-catalog-fixture.test.ts
  • apps/desktop/src/main/e2e-fixture.ts
  • apps/desktop/src/main/e2e-fixture/scenarios-settings.ts
  • packages/core/src/e2e-fixture.ts
  • scripts/audit-alignment.mjs
  • scripts/computer-use/real-model.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/computer-use/real-model.mjs

Included review availability: Your plan includes up to 3 reviews per rolling hour; 1 remains after this review.


📝 Walkthrough

Problem solved

This PR removes the unused llm-connections.json store. Runtime Policy’s connection-catalog.json becomes the sole connection authority.

Desktop E2E fixtures and the Computer Use script now use the catalog and credential vault. Existing llm-connections.json files remain on disk and are not imported or migrated.

Source of truth

The PR extends the existing Runtime Policy path. It does not create a parallel connection path.

It removes:

  • The connection-store implementation and tests
  • relayProfilesForStorage
  • The @maka/storage/connection-store export
  • Legacy fixture and script writes

The catalog format, credential vault, and Host bootstrap remain unchanged.

Scope and complexity

The changes are the smallest coherent solution for removing the obsolete store:

  • Production storage code and its tests are deleted.
  • Fixtures and scripts use existing catalog and vault APIs.
  • README files document the current storage layout and security boundaries.
  • The Computer Use script uses storage-root leasing and commit validation because it writes through Runtime Policy storage.

No migration path or parallel abstraction was added.

Deletion and simplification

The deleted implementation, helper, export, and tests can remain removed because their APIs no longer exist.

The E2E fixture no longer serializes legacy connections or stores unused metadata. The added fixture test covers catalog seeding, connection slugs, default targets, fetched model metadata, credential status, cleanup, and the absence of legacy connection files.

Validation and risks

Reported validation includes clean Biome checks, successful typechecks, passing Desktop tests, and a storage test suite with one unrelated flaky failure.

Required-check status remains unverified without direct check results.

Review-relevant risks

The PR removes the public @maka/storage/connection-store export and ConnectionStore APIs. This is a public contract change and requires independent human review under repository policy.

The PR changes Desktop E2E fixtures and Computer Use credential setup. These changes affect test and automation workflows and require independent human review under repository policy.

The person performing the merge must review the final diff, and a maintainer makes the final determination.

Walkthrough

The legacy connection store and public export are removed. Desktop fixtures and computer-use setup now use Runtime Policy storage. E2E scenarios use settings-models. Both README files document the new catalog and credential boundaries.

Changes

Connection catalog migration

Layer / File(s) Summary
Remove legacy connection store
packages/storage/package.json, packages/cli/src/workspace-root.ts
The legacy store export is removed. CLI comments identify @maka/storage as the workspace-root authority.
Migrate desktop fixture
apps/desktop/src/main/e2e-fixture/scenarios-settings.ts, apps/desktop/src/main/__tests__/connection-catalog-fixture.test.ts, apps/desktop/src/main/e2e-fixture.ts
The fixture seeds Runtime Policy catalog entries and credentials, sets the default target, and validates storage state and cleanup.
Migrate computer-use setup
scripts/computer-use/real-model.mjs
Provider setup copies the catalog and credential profiles, then creates and configures the OpenAI entry through leased runtime stores.
Update fixture scenarios
packages/core/src/e2e-fixture.ts, apps/desktop/src/main/e2e-fixture.ts, scripts/audit-alignment.mjs
The fetched-empty scenario is replaced with settings-models.
Update documented data layout
README.md, README.zh-CN.md
The README files document connection-catalog.json, separated credential files, and non-import of legacy files.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7a0ca

This PR removes an unused secondary connection store and updates fixtures and scripts to use the existing catalog and credential vault. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant FixtureOrScript
  participant InteractiveStorageRoot
  participant RuntimePolicyCatalog
  participant CredentialVault
  FixtureOrScript->>InteractiveStorageRoot: acquire storage lease
  FixtureOrScript->>RuntimePolicyCatalog: create or update catalog entry
  FixtureOrScript->>CredentialVault: store API key when required
  FixtureOrScript->>RuntimePolicyCatalog: set default target
  RuntimePolicyCatalog-->>FixtureOrScript: return commit result
Loading

Possibly related PRs

  • maka-agent/maka-agent#3111: Both changes move Desktop fixture persistence to authority-backed runtime storage, but they cover different storage domains.

Suggested reviewers: astro-han, jackwener

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly identifies removal of the obsolete llm-connections.json store, which is the primary change.
Description check ✅ Passed The description follows the template and includes the outcome, verification results, AI use, checklist status, and behavior change.
Linked Issues check ✅ Passed The changes satisfy the coding objectives in [#3107] by removing the obsolete store and updating dependent fixtures, scripts, and documentation.
Out of Scope Changes check ✅ Passed The changes remain within scope by removing the obsolete store and updating its dependent fixtures, scripts, documentation, and checks.
Ai Use Disclosure ✅ Passed The PR selects generative tooling, names Grok and its scope, and all three PR commits contain consistent standalone Generated-by: Grok trailers.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/desktop/src/main/__tests__/connection-catalog-fixture.test.ts (1)

16-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Delete two redundant statements.

Line 16 resolves the storage root and discards the capability. writeConnections resolves the root itself, so this call adds no setup. Line 27 is unreachable: assert.ok from node:assert/strict is typed as an assertion function, so owner is already narrowed after line 26.

♻️ Proposed simplification
-    await resolveStorageRoot({ path: workspaceRoot, kind: 'interactive' });
     await writeConnections(workspaceRoot, Date.now(), 'turn-narrative');
@@
     const owner = await tryAcquireInteractiveRootOwner(capability);
     assert.ok(owner);
-    if (!owner) return;
     try {

As per path instructions: "Flag concrete cases where code can be deleted or simplified."

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a8e09ac-910c-4c3f-b324-2715796b4274

📥 Commits

Reviewing files that changed from the base of the PR and between 8b79a6d and be1abaf.

📒 Files selected for processing (11)
  • README.md
  • README.zh-CN.md
  • apps/desktop/src/main/__tests__/connection-catalog-fixture.test.ts
  • apps/desktop/src/main/e2e-fixture/scenarios-settings.ts
  • packages/cli/src/workspace-root.ts
  • packages/storage/package.json
  • packages/storage/src/__tests__/connection-store.test.ts
  • packages/storage/src/connection-store.ts
  • packages/storage/src/index.ts
  • packages/storage/src/relay-profile-store.ts
  • scripts/computer-use/real-model.mjs
💤 Files with no reviewable changes (5)
  • packages/storage/src/relay-profile-store.ts
  • packages/storage/src/index.ts
  • packages/storage/src/connection-store.ts
  • packages/storage/src/tests/connection-store.test.ts
  • packages/storage/package.json

Included review availability: Your plan includes up to 3 reviews per rolling hour; 2 remain after this review.

Comment thread apps/desktop/src/main/e2e-fixture/scenarios-settings.ts Outdated
Comment thread README.zh-CN.md
Delete FileConnectionStore, its relay-profile helper, and the package
export. Desktop e2e and the Computer Use real-model script now seed
connection-catalog.json through the Runtime Policy writer. Existing
user llm-connections.json files stay inert on disk.

Fixes apache#3107

Generated-by: Grok
Throw if the fixture cannot resolve the zai-live connection id,
and drop the unused extra root resolve in the catalog test.

Generated-by: Grok
apache#2688 imported Plan Mode locale types from the removed @maka/core root
barrel. Other locale catalogs already use @maka/core/ui-locale and
@maka/core/plan. The root import breaks desktop main typecheck and
cascades through every PR that merges with main.

Generated-by: Grok
@1625567290
1625567290 force-pushed the fix/storage-remove-llm-connections-store branch from 7a0ca28 to 7de59f4 Compare August 16, 2026 11:39
@1625567290

Copy link
Copy Markdown
Contributor Author

The red typecheck / test_* / e2e jobs were the #2688 @maka/core root import on main, not the catalog-store deletion. Rebased onto main and switched plan-mode-copy.ts to the live @maka/core/plan and @maka/core/ui-locale subpaths. Dedicated fix is also in #3119.

@Astro-Han

Copy link
Copy Markdown
Contributor

Fast-path merge

This change qualifies for the self-merge fast path: it is low impact and easy to reverse (removes the leftover llm-connections.json store that Host never reads, plus its tests and exports), does not touch the protected areas (Runtime Host execution authority, @maka/eval semantics, public Eval CLI, security, licensing, releases, governance), and passes all required checks.

The latest head was independently reviewed by a read-only subagent (ollama-cloud/deepseek-v4-flash:high) with no open P0/P1/P2 findings. Human contributor @yuhan reviewed the final diff and chose the fast path.

@Astro-Han
Astro-Han merged commit 12d2ab5 into apache:main Aug 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(storage): remove the leftover llm-connections.json store

2 participants