Skip to content

fix: repair post-merge storage and Runtime Host contracts - #3796

Merged
M4n5ter merged 2 commits into
apache:mainfrom
liugddx:fix/session-migration-30-convergence
Aug 25, 2026
Merged

fix: repair post-merge storage and Runtime Host contracts#3796
M4n5ter merged 2 commits into
apache:mainfrom
liugddx:fix/session-migration-30-convergence

Conversation

@liugddx

@liugddx liugddx commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Repair two independent post-merge regressions that currently form a required-CI bootstrap loop on main:

  1. feat: durable message lifecycle from admission to execution #3721 and feat(workhub): add coordination session lifecycle #3764 both assigned session metadata migration version 30. JavaScript Map construction silently retained only the later migration, so current-main databases record version 30 without creating message_admissions.
  2. refactor(runtime-host): use typed request as sole operation API #3784 removed operation-specific RuntimeHostConnection aliases but left three queue-test calls on queryTurn, stopTurn, and startTurn, so current main does not build.

The fixes remain separate commits in this PR.

Migration compatibility

Schema version advances to 31. Migration 30 retains the admission-table authority introduced by #3721. Migration 31 uses guarded creation to converge every version-30 shape that may already exist:

Fresh/older databases run 30 then 31 and reach the same schema. Module initialization now verifies that migration keys cover every version exactly once by rejecting duplicate-or-missing Map entries.

The session metadata constructor also closes a newly opened DatabaseSync when schema configuration or migration rejects, so a newer-schema refusal does not leak its handle on Windows.

Runtime Host test migration

The three stale calls are migrated to the existing typed operations without changing inputs or assertions:

  • turn.query
  • turn.stop
  • turn.start

Verification

  • Session metadata store: 56 passed, 0 failed, including all three version-30 starting shapes and the five message-admission tests previously failing on main.
  • Core, Storage, MCP, Runtime, and Runtime Host builds: passed.
  • Runtime Host queue suite starts and exercises the repaired storage authority; 9/12 passed locally. Three tests hit the existing fixed 10-second Host-readiness deadline on this Windows machine, with no process error or protocol failure. The directly changed production UDS test passed in the first complete run; hosted CI is authoritative for timing.
  • lint, format, and git diff --check: passed.

Fixes #3788. Fixes #3790.

AI use

Codex diagnosed the semantic merge collision, implemented the compatibility migration and stale-call updates, and ran the listed checks.

Checklist

  • Tests cover the change and fail without it
  • Core/Storage/MCP/Runtime/Runtime Host builds pass locally
  • Session metadata migration and message-admission suites pass locally
  • Lint, format, and git diff --check pass
  • Exact-head required test passed before the trailer-only history rewrite; a fresh check was triggered for the new head

Does this PR entail a change in behavior?

  • Yes - existing version-30 databases converge to schema 31 without losing either merged authority; stale test callers use the supported typed request API.
  • No

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the typed-request migration and the version-30 schema convergence. The changes preserve the affected test semantics, cover every known merged version-30 shape, and keep initialization failure cleanup bounded. Current CI is green and later main commits do not overlap these files.

@M4n5ter
M4n5ter merged commit c4971c9 into apache:main Aug 25, 2026
1 check passed
yunaremaia added a commit to yunaremaia/maka that referenced this pull request Aug 25, 2026
M4n5ter pushed a commit to yunaremaia/maka that referenced this pull request Aug 26, 2026
M4n5ter pushed a commit to yunaremaia/maka that referenced this pull request Aug 26, 2026
M4n5ter pushed a commit to yunaremaia/maka that referenced this pull request Aug 26, 2026
M4n5ter pushed a commit to yunaremaia/maka that referenced this pull request Aug 26, 2026
Astro-Han added a commit that referenced this pull request Aug 28, 2026
* fix(core): add DeepSeek V4 Flash Vision to model metadata

deepseek-v4-flash-vision-exp is returned by the first-party /models
endpoint but was absent from STATIC_MODEL_METADATA, causing Maka to
classify it as text-only and filter image attachments before the
request reaches the provider.

Add the model ID with vision capability to both STATIC_MODEL_METADATA
and CURATED_CATALOG_FALLBACK_MODELS so the existing DeepSeek adapter
passes image content through.

Fixes: #3417

Signed-off-by: Yunare Maia <yunare@gmail.com>

* style: apply biome formatting to model metadata (CI fix)

* fix(core): include 'low' effort for deepseek-v4-flash-vision-exp

Per review: models.dev (refreshed 2026-08-21), the official Thinking Mode
guide, and the deepseek-v4-pro entry all confirm low/high/max. The pinned
['high','max'] was inherited from the stale pre-0731 sibling entry.

* fix(core): declare text/image modalities for deepseek-v4-flash-vision-exp

Add the explicit modalities entry suggested in review so attachment
routing sees image input without relying on generated snapshots, and
add a focused regression test covering vision resolution, input
modalities, and fallback-catalog presence for the bare model id.

Co-authored-by: Yunare Maia <yunare@gmail.com>

* chore: re-trigger CI after upstream main repair (#3796)

* fix(core): add displayName, description, lastUpdated for deepseek-v4-flash-vision-exp

Addresses reviewer feedback on #3605: adds displayName, description, and lastUpdated
fields to the STATIC_MODEL_METADATA entry so the model picker shows a friendly name
instead of the bare model ID.

Co-authored-by: Astro-Han <Astro-Han@users.noreply.github.com>

* style(core): biome format model-metadata.ts (description line wrap)

* test(core): add regression tests for DeepSeek V4 Flash Vision metadata

- Added tests to verify vision support, modalities, and metadata lookup
- Added catalog test for V4 vision model display metadata
- Fixes reviewer feedback on #3605

* fix(test): remove buildConnectionModelCatalogEntries import from model-metadata.test.ts

The function is exported from model-catalog.ts, not model-metadata.ts.
Local vitest runs pass because it compiles differently than tsc.

---------

Signed-off-by: Yunare Maia <yunare@gmail.com>
Co-authored-by: Astro-Han <Astro-Han@users.noreply.github.com>
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.

fix(runtime-host): migrate queue tests off removed connection aliases fix(storage): converge duplicate session metadata migration 30

2 participants