fix: fix snake_case function names in code_execution instructions#7035
Merged
alexhancock merged 1 commit intoblock:mainfrom Feb 6, 2026
Merged
fix: fix snake_case function names in code_execution instructions#7035alexhancock merged 1 commit intoblock:mainfrom
alexhancock merged 1 commit intoblock:mainfrom
Conversation
10 tasks
codefromthecrypt
approved these changes
Feb 6, 2026
alexhancock
reviewed
Feb 6, 2026
| - Function names are always camelCase (e.g., Developer.textEditor, Github.listIssues, Github.createIssue) | ||
| - Return value from `run()` is the result, all `console.log()` output will be returned as well. | ||
| - Only functions from `list_functions()` are available - no `fetch()`, fs, or other Node/Deno APIs | ||
| - Only functions from `list_functions()` are available, plus `fetch()` (restricted to allowed hosts) and `console` methods |
Collaborator
There was a problem hiding this comment.
should we add console to list_functions instead?
i also imagine keeping
no `fetch()`, fs, or other Node/Deno APIs
as-is is ok right?
Contributor
Author
There was a problem hiding this comment.
I think console is part of the sandbox runtime layer, not the tool/MCP layer. Adding it to list_functions would require modifying the upstream pctx_code_mode, right?
pctx mentions fetch as host restricted https://github.com/portofcontext/pctx/blob/main/crates/pctx_code_execution_runtime/src/lib.rs#L34, but yeah we can leave it as is.
The execute tool description used snake_case function names (e.g., `Developer.text_editor`, `Github.create_issue`) but the TypeScript runtime expects camelCase (`Developer.textEditor`, `Github.createIssue`) since pctx_codegen converts all MCP tool names to camelCase. This causes TS2551 type errors at runtime. Also: - Added explicit "Function names are always camelCase" rule with examples. - Added HANDLING RETURN VALUES section: many MCP tools return wrapper objects not raw arrays, causing `TypeError: x.filter is not a function` when LLMs assume array returns. Signed-off-by: rabi <ramishra@redhat.com>
f467bc3 to
d8a0ffe
Compare
alexhancock
approved these changes
Feb 6, 2026
zanesq
added a commit
that referenced
this pull request
Feb 6, 2026
* origin/main: Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) fix(codex): propagate extended PATH to codex subprocess (#6874) Switch tetrate tool filtering back to supports_computer_use (#7024) feat(ui): add inline rename for chat sessions in sidebar (#6995) fix: handle toolnames without underscores (#7015) feat(claude-code): use stream-json protocol for persistent sessions (#7029) test(providers): add model listing to live provider suite (#7038) Agent added too much (#7036) fix(deps): bump tree-sitter to 0.26 and set sqlx default-features=false to fix RUSTSEC advisories (#7031) feat: add image support and improve error resilience for Codex (#7033) fix(providers): Azure OpenAI model listing 404 during configure (#7034) fix(deps): bump bat to 0.26.1 to resolve RUSTSEC-2026-0008 (#7021) Don't swallow Tetrate errors (#6998) docs: remove hardcoded_stuff links (#7016) # Conflicts: # ui/desktop/src/components/GooseSidebar/AppSidebar.tsx
kuccello
pushed a commit
to kuccello/goose
that referenced
this pull request
Feb 7, 2026
…ock#7035) Signed-off-by: rabi <ramishra@redhat.com>
tlongwell-block
added a commit
that referenced
this pull request
Feb 9, 2026
* origin/main: (55 commits) test(mcp): add image tool test and consolidate MCP test fixtures (#7019) fix: remove Option from model listing return types, propagate errors (#7074) fix: lazy provider creation for goose acp (#7026) (#7066) Smoke tests: split compaction test and use debug build (#6984) fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061) feat: expose AGENT_SESSION_ID env var to extension child processes (#7072) fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882) Remove clippy too_many_lines lint and decompose long functions (#7064) refactor: move disable_session_naming into AgentConfig (#7062) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) ... # Conflicts: # scripts/test_subrecipes.sh
lifeizhou-ap
added a commit
that referenced
this pull request
Feb 9, 2026
* main: (101 commits) fix: lazy provider creation for goose acp (#7026) (#7066) Smoke tests: split compaction test and use debug build (#6984) fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061) feat: expose AGENT_SESSION_ID env var to extension child processes (#7072) fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882) Remove clippy too_many_lines lint and decompose long functions (#7064) refactor: move disable_session_naming into AgentConfig (#7062) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) ...
dianed-square
added a commit
that referenced
this pull request
Feb 9, 2026
* origin/main: (141 commits) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) fix(codex): propagate extended PATH to codex subprocess (#6874) Switch tetrate tool filtering back to supports_computer_use (#7024) feat(ui): add inline rename for chat sessions in sidebar (#6995) fix: handle toolnames without underscores (#7015) feat(claude-code): use stream-json protocol for persistent sessions (#7029) test(providers): add model listing to live provider suite (#7038) Agent added too much (#7036) ...
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
…ock#7035) Signed-off-by: rabi <ramishra@redhat.com>
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
…ock#7035) Signed-off-by: rabi <ramishra@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The execute tool description used snake_case function names (e.g.,
Developer.text_editor,Github.create_issue) but the TypeScript runtime expects camelCase (Developer.textEditor,Github.createIssue) since pctx_codegen converts all MCP tool names to camelCase. This causes TS2551 type errors at runtime.Also:
TypeError: x.filter is not a functionwhen LLMs assume array returns.fetch()(host-restricted) andconsolemethods are available, not forbidden. Removed Deno-specific references.Type of Change
AI Assistance
Testing
Tested locally with nemotron nano and the results are much better.