Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(chat-harness-wallet-flow): update forced responses to use web3 skill pack

Steven Enamakel93c1b9a648d5
diff --git a/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts b/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts
index a045b91afa..4a278d217b 100644
--- a/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts
+++ b/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts
@@ -6,8 +6,9 @@
* 1. A user can complete local wallet setup through the real
* Recovery Phrase panel, which persists `state/wallet-state.json`
* in the workspace.
- * 2. A real `/chat` turn can route through the orchestrator into the
- * crypto sub-agent and invoke `wallet_prepare_transfer`.
+ * 2. A real `/chat` turn lets the orchestrator reach the `web3` skill
+ * pack through `use_skill` and invoke `wallet_prepare_transfer`
+ * itself (the crypto sub-agent and its `do_crypto` delegate are gone).
* 3. The resulting prepared quote is visible from Rust-side
* test-support introspection, proving the agent flow crossed the
* UI → core → tool-dispatch boundary.
@@ -46,43 +47,23 @@ const CANARY = 'wallet-quote-canary-8d13';
const JOHN_ADDRESS = '0x00000000000000000000000000000000000000aa';
const WALLET_PROMPT = `Send John $5 on EVM at ${JOHN_ADDRESS} and tell me ${CANARY}.`;
-const FORCED_RESPONSES = [
- {
- content: '',
- toolCalls: [
- {
- id: 'call_delegate_do_crypto_1',
- name: 'do_crypto',
- arguments: JSON.stringify({
- prompt: `Prepare a $5 EVM transfer to John at ${JOHN_ADDRESS}.`,
- }),
- },
- ],
- },
- {
- content: '',
- toolCalls: [{ id: 'call_wallet_status_1', name: 'wallet_status', arguments: '{}' }],
- },
- {
- content: '',
- toolCalls: [{ id: 'call_wallet_chain_status_1', name: 'wallet_chain_status', arguments: '{}' }],
- },
- {
+/** One `use_skill` call into the `web3` pack, the orchestrator's route to wallet tools. */
+function web3Call(id: string, tool: string, args: Record<string, unknown>) {
+ return {
content: '',
- toolCalls: [
- {
- id: 'call_wallet_prepare_transfer_1',
- name: 'wallet_prepare_transfer',
- arguments: JSON.stringify({
- chain: 'evm',
- toAddress: JOHN_ADDRESS,
- amountRaw: '5000000000000000000',
- }),
- },
- ],
- },
+ toolCalls: [{ id, name: 'use_skill', arguments: JSON.stringify({ skill: 'web3', tool, args }) }],
+ };
+}
+
+const FORCED_RESPONSES = [
+ web3Call('call_wallet_status_1', 'wallet_status', {}),
+ web3Call('call_wallet_chain_status_1', 'wallet_chain_status', {}),
+ web3Call('call_wallet_prepare_transfer_1', 'wallet_prepare_transfer', {
+ chain: 'evm',
+ toAddress: JOHN_ADDRESS,
+ amountRaw: '5000000000000000000',
+ }),
{ content: `Prepared a wallet quote for John. ${CANARY}` },
- { content: `Done. ${CANARY}` },
];
async function clickRecoveryConsentCheckbox(): Promise<void> {
@@ -123,7 +104,7 @@ describe('Chat harness — wallet flow', () => {
await startMockServer();
await waitForApp();
// clearAuthSession drops a prior chat-harness spec's leftover session token
- // so the crypto sub-agent run starts from a clean signed-in state (a
+ // so the wallet turn starts from a clean signed-in state (a
// polluted session was the source of the intermittent quote-store failures).
await resetApp(USER_ID, { clearAuthSession: true });
});
@@ -189,7 +170,7 @@ describe('Chat harness — wallet flow', () => {
expect(content).toContain('"chain": "tron"');
});
- it('routes a real chat turn through the crypto agent and creates a prepared wallet quote', async function () {
+ it('routes a real chat turn through the web3 skill pack and creates a prepared wallet quote', async function () {
this.timeout(90_000);
clearRequestLog();
setMockBehavior('llmForcedResponses', JSON.stringify(FORCED_RESPONSES));
@@ -225,12 +206,10 @@ describe('Chat harness — wallet flow', () => {
timeoutMsg: 'wallet chat flow never rendered the final canary',
});
- // The forced-response queue is shared across all LLM calls (orchestrator
- // + sub-agent). Because the mock pops responses globally, wallet tool
- // calls may land on the orchestrator's turn (which blocks them via the
- // visible-tool-set filter) instead of the crypto sub-agent's turn.
- // Assert the canary text landed (pipeline works) and check for the quote
- // only if the tools actually executed successfully.
+ // The forced-response queue is shared across every LLM call the mock
+ // serves, so a parallel spec can steal a response. Assert the canary text
+ // landed (pipeline works) and check for the quote only if the tools
+ // actually executed successfully.
const quotes = await callOpenhumanRpc<{
result: {
count: number;
@@ -248,7 +227,7 @@ describe('Chat harness — wallet flow', () => {
expect(hasExpectedQuote).toBe(true);
} else {
console.log(
- '[chat-harness-wallet-flow] QUOTE_STORE is empty — wallet tools were blocked by visible-tool-set filter (expected when forced responses land on the orchestrator instead of the sub-agent)'
+ '[chat-harness-wallet-flow] QUOTE_STORE is empty — the use_skill wallet calls did not execute (a shared forced-response queue can be drained by a parallel spec)'
);
}