Skip to content

Commit 4e9d0ee

Browse files
Copilothotlong
andauthored
fix: restructure MetadataPlugin driver bridging fallback and increase client test timeouts
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/0c89186e-7d01-4390-b9c7-0e874e5dba72 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 1f4dabd commit 4e9d0ee

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- Preserved skill independence — Each skill remains independently installable/referenceable (no global routing required)
2727

2828
### Fixed
29+
- **MetadataPlugin driver bridging fallback** — Fixed `MetadataPlugin.start()` so the driver service scan fallback (`driver.*`) is reached when ObjectQL returns `null` (not just when it throws). Previously, `setDatabaseDriver` was never called in environments where ObjectQL was not loaded.
30+
- **Client Hono integration test timeout** — Increased `beforeAll`/`afterAll` hook timeouts in `client.hono.test.ts` from default 10s to 30s to prevent flaky failures in CI.
2931
- **CI: Replace `pnpm/action-setup@v6` with corepack** — Switched all GitHub Actions workflows (`ci.yml`, `lint.yml`, `release.yml`, `validate-deps.yml`, `pr-automation.yml`) from `pnpm/action-setup@v6` to `corepack enable` to fix persistent `ERR_PNPM_BROKEN_LOCKFILE` errors. Corepack reads the exact `packageManager` field from `package.json` (including SHA verification), ensuring the correct pnpm version is used in CI. Also bumped pnpm store cache keys to v3 and added a pnpm version verification step.
3032
- **Broken pnpm lockfile** — Regenerated `pnpm-lock.yaml` from scratch to fix `ERR_PNPM_BROKEN_LOCKFILE` ("expected a single document in the stream, but found more") that was causing all CI jobs to fail. The previous merge of PR #1117 only included workflow cache key changes but did not carry over the regenerated lockfile.
3133
- **service-ai: Fix navigation item labels using deprecated i18n object format** — Replaced `{ key, defaultValue }` i18n objects with plain string labels in `AIServicePlugin`'s Setup App navigation contributions, completing the `I18nLabelSchema` migration from [#1054](https://github.com/objectstack-ai/framework/issues/1054).

packages/client/src/client.hono.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ describe('ObjectStackClient (with Hono Server)', () => {
107107
baseUrl = `http://localhost:${port}`;
108108

109109
console.log(`Test server running at ${baseUrl}`);
110-
});
110+
}, 30_000);
111111

112112
afterAll(async () => {
113113
if (kernel) await kernel.shutdown();
114-
});
114+
}, 30_000);
115115

116116
it('should connect to hono server and discover endpoints', async () => {
117117
const client = new ObjectStackClient({ baseUrl });

packages/metadata/src/plugin.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export class MetadataPlugin implements Plugin {
107107
// Bridge database driver from kernel service registry to MetadataManager.
108108
// Uses ObjectQL engine's datasource mapping to resolve the correct driver
109109
// for sys_metadata (respects namespace → datasource routing).
110+
// Falls back to the first available driver.* service when ObjectQL is unavailable.
111+
let driverBridged = false;
110112
try {
111113
const ql = ctx.getService<any>('objectql');
112114
if (ql) {
@@ -118,12 +120,17 @@ export class MetadataPlugin implements Plugin {
118120
driver: driver.name,
119121
});
120122
this.manager.setDatabaseDriver(driver);
123+
driverBridged = true;
121124
} else {
122125
ctx.logger.debug('[MetadataPlugin] ObjectQL could not resolve driver for metadata table', { tableName });
123126
}
124127
}
125128
} catch {
126-
// ObjectQL not available — fall back to first available driver service
129+
// ObjectQL not available — will fall through to driver service fallback below
130+
}
131+
132+
// Fallback: scan for driver.* services when ObjectQL didn't provide a driver
133+
if (!driverBridged) {
127134
try {
128135
const services = ctx.getServices();
129136
for (const [serviceName, service] of services) {

0 commit comments

Comments
 (0)