Hasty Briefsbeta

Bilingual

What Is Codemode

5 hours ago
  • Pi now supports MCP through Codemode, allowing LLM to issue tool calls from JavaScript without loading them into context.
  • Bash has fundamental limitations for non-program tools like reading images or spawning sub agents; Codemode separates the harness (brain) from the execution environment (hands).
  • Codemode runs in a sandboxed JavaScript environment (QuickJS/WASM) with no network, file system, or timers, enabling concurrent operations and state persistence.
  • Examples include image generation via internal APIs, sentiment analysis on GitHub issues using classifiers, driving a game loop for debugging, and calling MCP servers like Sentry.
  • MCP benefits from Codemode, but current MCP servers are often not optimized for it; recommendations include exposing tools via outputSchema and using verbose tool definitions.
  • This is not a reversal of the earlier CLI advocacy; Codemode is an additional mechanism for harness-side freedom. Challenges remain in durability, smaller model support, and binary data handling.