From 7c3bd75bcca7df8750a50de28f920bf06c989a0e Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:56:39 +0800 Subject: [PATCH] test(remotes): unwrap the Remote envelope in the built-lib chain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every generated method resolves to RemoteResult, so the plain-Node script must read the business value through `.value`: the CAS ref it passed on to goals/edit was undefined, which the client codec rejected before the request left. The invalid-payload case keeps its try/catch — a codec-rejected argument still throws at the Client Remote face rather than folding into the error branch. --- packages/api/remotes/tests/built-lib.e2e.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/api/remotes/tests/built-lib.e2e.ts b/packages/api/remotes/tests/built-lib.e2e.ts index be76cd148c..80d194ee0e 100644 --- a/packages/api/remotes/tests/built-lib.e2e.ts +++ b/packages/api/remotes/tests/built-lib.e2e.ts @@ -147,19 +147,21 @@ describe.skipIf(!requiredArtifacts)('Goal Remote built LIB chain', () => { } catch { invalidRejected = true } + // Every generated method resolves to the RemoteResult envelope; the + // business values below are what the assertions pin. const rootResult = await client.remote.goals.create(rootAgent.id, { objective: 'root goal' }) const rootEdit = await client.remote.goals.edit( rootAgent.id, - rootResult.ref, + rootResult.value.ref, { objective: 'edited root goal' }, ) const agentContext = client.extend({ builtAgentId: scopedAgent.id }) const scopedResult = await agentContext.remote.goals.create({ objective: 'scoped goal', maxGoalRounds: 3 }) const result = { invalidRejected, - rootResult, - rootEdit, - scopedResult, + rootResult: rootResult.value, + rootEdit: rootEdit.value, + scopedResult: scopedResult.value, rootGoal: host.goals.get(rootAgent)?.objective, scopedGoal: host.goals.get(scopedAgent)?.objective, rootEvents: rootAgent.session.events.length,