Jelajahi Sumber

test(remotes): unwrap the Remote envelope in the built-lib chain

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.
imccyu 1 bulan lalu
induk
melakukan
7c3bd75bcc
1 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 6 4
      packages/api/remotes/tests/built-lib.e2e.ts

+ 6 - 4
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,