Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thanks for taking #2077 on so quickly, and for the RED/GREEN evidence — the diagnosis is right: OpenCode's newer config loader validates One thing turned up when running the generated module through OpenCode's own loaders, though. There are two of them, and the one that actually fires The shape that satisfies both loaders: export default {
id: 'codebase-memory-augment',
// server runtime: reads default.server and dispatches the hooks it returns
server: async (ctx) => { /* the existing hook object */ },
// V2 config loader: requires id + setup|effect; no tool domain yet, so nothing to register
setup() {},
};Could you switch |
OpenCode's V2 loader validates only the module's default export,
expecting {id, setup()|effect()}. cbm_client_adapter_opencode still
emitted the V1 named export (export const CodebaseMemory = ...), so
every server start failed with SchemaError: Missing key at ["default"].
Wrap the existing hook logic in a default export with an id and a
setup(ctx) function; the returned hooks object is unchanged.
Fixes DeusData#2077
Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
dc34e63 to
8f3c150
Compare
|
This one's green across all 34 legs and has had no comments in a week. Anything you'd want changed before merging? |
|
Thank you for the loader follow-up. The current head still returns hooks from asynchronous setup, while the earlier requested contract was to place them in the server entry and leave setup empty. Please reconcile both code and tests with that requested shape, preserving the |
DeusData asked (2026-09-19T20:25:34Z on PR DeusData#2089) to place the hooks in the server entry rather than returning them from setup(), since the server runtime reads default.server and dispatches the hooks it returns, while the V2 config loader only reads id + setup()/effect() and has no tool domain yet to register against. Moved the existing hook body under server: async (ctx) => {...} and added an empty setup() {}. Updated the emission test to check for both and to assert the old async setup(ctx) { shape is gone. Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Pushed e171bd4: moved the hooks under server: async (ctx) => {...} and left setup() {} empty, matching the shape you asked for. Updated the emission test to check both server: and setup() {}, and to assert the old async setup(ctx) form is gone. Full local suite green, 7989 passed / 0 failed. |
OpenCode's V2 plugin loader only reads the default export and requires an id plus a setup() or effect() function.
cbm_client_adapter_opencodestill generated the old named export (export const CodebaseMemory = async (ctx) => {...}), so every server start failed withSchemaError: Missing key at ["default"], and the workaround gets overwritten on every install/update since the file is regenerated.Wrapped the same hook logic in a default export with
id: 'codebase-memory-augment'andasync setup(ctx); the returned hooks object (tool.execute.after,experimental.session.compacting) is unchanged.Added a test asserting the generated module has the default export shape and no longer contains the old named export. Ran
scripts/test.sh --suites agent_clientson Ubuntu 24.04: the new test fails without the change and the suite is green on the branch (38 tests).Fixes #2077