Skip to content

Conversation

@ian
Copy link
Owner

@ian ian commented Nov 17, 2025

Summary by cubic

Updated blockchain, XMTP, and agent behavior docs to match the current Hybrid API and runtime model, fixing incorrect imports, usage patterns, and removing unsupported features to prevent misleading examples.

  • Bug Fixes

    • Replaced all imports from @hybrd/core with hybrid and updated behavior/tool imports.
    • Corrected behavior usage to agent.listen({ behaviors: [...] }) with filterMessages, threadedReply, and reactWith.
    • Clarified that tools are invoked automatically during conversations and showed how to use runtime in custom tools.
    • Updated BehaviorContext fields and types to reflect XMTP and runtime access (message, conversation, xmtpClient, response, sendOptions).
    • Rebuilt blockchain docs: simple install/setup, runtime config (rpcUrl/privateKey/defaultChain), supported chains, and custom tool examples using viem.
    • Cleaned XMTP docs: runtime-first examples for sending messages, replies, and reactions; removed unsupported/”future” features.
    • Added concise best practices: env vars for keys, input validation, and error handling.
  • Migration

    • Update imports to hybrid and use hybrid/behaviors in examples.
    • Use agent.listen with a behaviors array instead of agent.use.
    • Access XMTP and blockchain via runtime inside custom tools (conversation, xmtpClient, rpcUrl, privateKey).
    • Adjust to the new BehaviorContext shape and sendOptions flags (filtered, threaded, contentType, metadata).

Written for commit f863d65. Summary will update automatically on new commits.

@linear
Copy link

linear bot commented Nov 17, 2025

HYBRID-64 Docs are wrong

@ian ian changed the title Fix docs to not halucinate Fix docs to not hallucinate Nov 17, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ian ian changed the title Fix docs to not hallucinate Fix docs + examples Nov 17, 2025
@ian ian merged commit a1c8591 into main Nov 17, 2025
11 of 12 checks passed
@ian ian deleted the ian/hybrid-64-docs-are-wrong branch November 17, 2025 17:48
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="site/docs/pages/tools/blockchain.md">

<violation number="1" location="site/docs/pages/tools/blockchain.md:153">
The &quot;Custom Transaction Tool&quot; example uses `createTool` and `z` but never imports them, so the sample cannot run when copied.</violation>
</file>

<file name="site/docs/pages/tools/xmtp.md">

<violation number="1" location="site/docs/pages/tools/xmtp.md:100">
ContentTypeText is imported from `@xmtp/content-type-reply`, but that package does not export it, so the sample code will not compile; import ContentTypeText from `@xmtp/content-type-text` instead.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

import { privateKeyToAccount } from "viem/accounts"
import { mainnet } from "viem/chains"

const sendWithRetryTool = createTool({
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Custom Transaction Tool" example uses createTool and z but never imports them, so the sample cannot run when copied.

Prompt for AI agents
Address the following comment on site/docs/pages/tools/blockchain.md at line 153:

<comment>The &quot;Custom Transaction Tool&quot; example uses `createTool` and `z` but never imports them, so the sample cannot run when copied.</comment>

<file context>
@@ -7,800 +7,340 @@ description: Built-in blockchain tools for crypto operations and DeFi interactio
+import { privateKeyToAccount } from &quot;viem/accounts&quot;
+import { mainnet } from &quot;viem/chains&quot;
+
+const sendWithRetryTool = createTool({
+  description: &quot;Send transaction with automatic retry&quot;,
+  inputSchema: z.object({
</file context>
Fix with Cubic

})
import { createTool } from "hybrid"
import { z } from "zod"
import { ContentTypeReply, ContentTypeText } from "@xmtp/content-type-reply"
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContentTypeText is imported from @xmtp/content-type-reply, but that package does not export it, so the sample code will not compile; import ContentTypeText from @xmtp/content-type-text instead.

Prompt for AI agents
Address the following comment on site/docs/pages/tools/xmtp.md at line 100:

<comment>ContentTypeText is imported from `@xmtp/content-type-reply`, but that package does not export it, so the sample code will not compile; import ContentTypeText from `@xmtp/content-type-text` instead.</comment>

<file context>
@@ -37,224 +37,229 @@ await agent.listen({
-    })
+import { createTool } from &quot;hybrid&quot;
+import { z } from &quot;zod&quot;
+import { ContentTypeReply, ContentTypeText } from &quot;@xmtp/content-type-reply&quot;
+
+const replyTool = createTool({
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants