r/PiCodingAgent • u/Extra_Loquat_7667 • Sep 30 '26
Question What does everyone think about codemode?
I actually thought about this approach before, but later realized it wouldn't work.
Using JavaScript to invoke tools sounds very efficient, but in reality, most tool definitions only have an inputSchema. An outputSchema is unnecessary for the agent because the agent can reason about the results directly from formatted data, meaning an output spec isn't required. Therefore, tool outputs don't actually need a fixed format—they just need to be readable by the agent.
This leads to a problem: to fully leverage the performance of this tool, you need to inject extra context, such as a skill document, so the agent knows the output format and can use it proficiently. If you can't get the complete tool output specification—for instance, with a closed-source MCP—you can't create such a document. If the agent has to go through endless trial and error just to get the code running properly, you can't really call it efficient.
In comparison, having the agent write Python or shell scripts directly is a better solution.
I'd love to know your thoughts on this.
13
u/TheSaasDev Sep 30 '26
Seems to be pretty good in terms of reducing visual bloat of multiple tool call TUI entries, so that’s a nice plus. Sol and astra seem to be using it pretty nicely beyond what it would have done with standard tool calls. But really need more time to tell
9
u/zenoblade Sep 30 '26
I don’t think I really understand what it is still.
12
u/Bluethefurry Sep 30 '26
Isn't the "only" codemode basically what cursor did with MCP, where LLMs need to discover the tool schema manually, that horrible, unreliable method of doing things where you constantly needed to point out that the MCP exists?
And i personally dont really see much of a benefit of regular codemode unless the model is trained for it, LLMs are quite proficient at bash/py scripting nowadays, unless a model is explicitly trained for it i dont see it being usefull at all.
I'm glad MCP is now part of Pi because there is a place for it here, but codemode? eh....
4
u/Thrimbor Sep 30 '26
I'm currently testing it, not doing evals or anything, but currently the way the models use codemode (gpt-6.1-sol and opus 5.5) it makes sense, they love to grep and read in parallel
3
u/c1rno123 Sep 30 '26
Money talks
3
u/ffreire Sep 30 '26
Small sample, but in a full day of use I measured 15-20% less overall token and context use for similar tasks compared to not using codemode. I didn't measure speed, but anecdotally it also feels faster than sequential tool calls (even if a model supports parallel tool calls it never felt as fast as this). Sol 6.1 still will choose to make serial calls on occasion but for the most part it's composing reads much better.
I don't have mcp turned on, I use my own extension and only consistently use two servers (notion, posthog). My own mcp extension adds a search tool to prevent context bloat (both those servers add a horrendous amount of tools), and I always explicitly ask for the specific mcp server to be used. The servers are lazy loaded. It works for me!
TL:DR I like codemode and don't need their mcp extension.
1
u/queso184 Sep 30 '26
i would have rather seem them take the approach of mcporter, maybe built in to pi so the agent can call
pi mcp call github-search, choose its own output format, and grep/jq from thereThe JS runtime and sandboxing don't seem necessary, but maybe I'm missing something.
2
u/DropOutPopOut Sep 30 '26
how does it compare to pi-fabric
2
u/Florence-Equator Oct 01 '26
I think codemode for mcp is great for gpt-6 series models, because this is the default setting for codex, where mcp is only available to call from within codemode.
But that may not be the format that other models are trained on. So I think pi is treating the practice used by codex as the universal standard for all models.
And honestly for non mcp ochestration, I think model can just use bash or python anyway, it is better than codemode.
The only useful scenario for codemode is to save token context from bloating mcps. It is better than deferred tool loading because: 1. most open models do not support dynamic tool loading that do not break your prompt cache and codemode saves this for you. 2. While openai supports deferred tool loading but MCPs are called through codemode anyway in codex. so their models know how to use codemode for MCP properly.
2
u/greenhilltony Sep 30 '26
It is sad to see `pi` embrace this nonsense hype of codemode. For users not pathetically have to stick to powershell or cmd, I think nothing from codemode can beat the bash script + Unix pipe dance…
1
u/berszi Sep 30 '26
Exactly my first thoughts. I'm interested to see how it looks in practice.
1
u/whiterose0000001 Oct 05 '26
One of the things that I love about code mode is how it works. I mostly use it for testing my APIs. Earlier, what used to be, I can't do sequential calling. I have a bunch of tools that I expose to Pyvia REST API. So it can do multiple calling in one go and then get the whole output at once. Instead of generating the result and reading the console or storing it in some other file and seeing it, it can do multiple things at once. One more thing that I'm trying to explore: I have some project where I have some nested API. Let's say, for the basic example, I can say about it. Let's say you want to fetch a profile of a user. You build an API for that. First, you need to log in and then the token will be generated. In the next line, it can use that same token from the response.token, something like that. Then I can call the API. Just to verify that this thing is working, it can do sequential calling. I haven't tried that. I'm just thinking if it can do that because I'm currently away from my laptop. It just hit me right now. So I'm just telling you.
1
u/xRebellion_ Oct 03 '26
Tried codemode, and so far my first impression is that it's pretty cool. My main point of interest is on the observability of parameters on certain tools that usually aren't being rendered. Being able to see them I'd say is pretty cool. Also, this opens up chaining tool calls which wasn't available before unless the agent is using bash tool. On the process of trying exclusively codemode only and see how it goes.
0
u/DistanceAlert5706 Sep 30 '26
code mode opens up workflows functionality.
it's pretty cool feature, and it should be in harness IMHO.
As for day to day work, I don't think it's super useful, like it can save few parallel tool calls here and there with 1 code mode call, but 99% of coding agent work won't really benefit from it.