Skip to content

fix: use snake_case for model-facing tool inputs - #303

Open
luo-xingyu wants to merge 2 commits into
Waishnav:mainfrom
luo-xingyu:fix/model-facing-snake-case
Open

fix: use snake_case for model-facing tool inputs#303
luo-xingyu wants to merge 2 commits into
Waishnav:mainfrom
luo-xingyu:fix/model-facing-snake-case

Conversation

@luo-xingyu

@luo-xingyu luo-xingyu commented Sep 5, 2026

Copy link
Copy Markdown

This addresses the model-facing input naming part of #297. ChatGPT can mangle camelCase tool fields such as yieldTimeMs, so DevSpace now exposes snake_case names at the MCP boundary while keeping its internal/domain objects and structured outputs in their existing camelCase form.

The change applies the same boundary consistently across the core, Claude, Codex, and artifact tool surfaces. It also updates the historical show_changes UI call and open_workspace instructions so callers use the returned workspaceId as workspace_id on subsequent tool calls. The intermittent MCP disconnects described in #297 are intentionally not part of this PR.

I verified the current branch against the latest main: the full test suite passes (109 tests, 104 passed, 5 platform-specific skips), TypeScript typechecking passes, and the production build completes successfully.

Summary by CodeRabbit

  • Changed
    • Standardized tool inputs on snake_case naming, including workspace, file-editing, shell, process, and worktree parameters.
    • Historical reviews now reopen with the correct workspace and review reference information.
  • Documentation
    • Clarified how to reuse the workspace identifier returned when opening a workspace.
    • Updated artifact downloads, file/search/edit/shell workflows, security guidance, and worktree instructions to reflect the standardized parameter names.
  • Tests
    • Added coverage validating input schemas, tool execution, and historical review requests.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 988caeaa-ce66-4dc1-bdb8-56d0e48ccea2

📥 Commits

Reviewing files that changed from the base of the PR and between 8c5a501 and 0e78ad8.

📒 Files selected for processing (14)
  • docs/artifact-exchange.md
  • docs/chatgpt-coding-workflow.md
  • docs/gotchas.md
  • docs/security.md
  • src/artifact-download.test.ts
  • src/artifact-tools.ts
  • src/server.test.ts
  • src/server.ts
  • src/tool-surfaces/claude.ts
  • src/tool-surfaces/codex.ts
  • src/tool-surfaces/types.ts
  • src/ui/tool-result.test.ts
  • src/ui/tool-result.ts
  • src/ui/workspace-app.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change standardizes MCP tool inputs on snake_case names, updates handlers and instructions, adds schema and runtime coverage, and centralizes historical review payload construction.

Changes

Tool input naming and documentation

Layer / File(s) Summary
Core tool contracts and workspace handling
src/server.ts, src/artifact-tools.ts, src/tool-surfaces/types.ts, docs/*
Core tools and documentation now use workspace_id and base_ref. Handlers map these names to existing internal variables.
Claude and Codex tool surfaces
src/tool-surfaces/claude.ts, src/tool-surfaces/codex.ts
Claude and Codex schemas use snake_case fields. Handlers map them to existing downstream calls.
Schema and runtime validation
src/server.test.ts, src/artifact-download.test.ts
Tests validate recursive schema naming, renamed arguments, runtime tool inputs, and artifact logging.
Historical review payload construction
src/ui/tool-result.ts, src/ui/tool-result.test.ts, src/ui/workspace-app.tsx
A shared helper creates historical show_changes calls with workspace_id and review metadata.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 0e78a

MCP tool inputs now consistently use snake_case while internal and structured-output identifiers remain unchanged. Workspace-scoped and historical review calls use the updated payload shape, with no current merge-blocking risk identified.

Suggested reviewers: waishnav

Poem

A rabbit renames each field in a row
Snake_case paths make the tool calls flow
Workspace ids hop from hand to hand
Tests check the shapes as planned
Review notes bloom across the land

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 10 files. (4 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: updating model-facing tool inputs to use snake_case.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 10 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR consistently changes model-facing MCP tool inputs from camelCase to snake_case while preserving camelCase internal objects, structured outputs, and workspace state.

  • Maps snake_case inputs back to existing domain and process APIs at each tool handler.
  • Updates Claude, Codex, shared server, artifact-download, and historical-review UI call surfaces.
  • Adds schema-wide and runtime tests for the new boundary.
  • Updates user documentation and workspace instructions to explain that returned workspaceId values must be passed as workspace_id.

Confidence Score: 5/5

The PR appears safe to merge; the renamed MCP inputs are consistently mapped at the boundary and covered by schema and runtime tests.

No actionable failures remain: internal camelCase contracts and structured outputs are preserved, all examined model-facing schemas and callers use snake_case, and historical review restoration matches the updated server contract.

Important Files Changed

Filename Overview
src/server.ts Renames shared workspace and worktree inputs, updates instructions, and preserves existing internal and output contracts.
src/tool-surfaces/claude.ts Converts Claude workspace, edit, and working-directory inputs to snake_case with explicit internal mappings.
src/tool-surfaces/codex.ts Converts patch and process-control inputs to snake_case while retaining camelCase process-session APIs and outputs.
src/artifact-tools.ts Changes artifact workspace selection to workspace_id without altering download validation or publication behavior.
src/ui/tool-result.ts Updates historical review reload requests to match the new show_changes input contract.
src/server.test.ts Adds recursive schema naming checks and end-to-end coverage for representative Claude and Codex calls.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["open_workspace output<br/>workspaceId"] --> B["Model-facing MCP call<br/>workspace_id"]
  B --> C["Tool handler boundary"]
  C --> D["Internal domain API<br/>workspaceId"]
  D --> E["Structured output<br/>camelCase preserved"]
  E --> F["Subsequent MCP input<br/>snake_case"]
Loading

Reviews (1): Last reviewed commit: "fix: align workspace tool callers with s..." | Re-trigger Greptile

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.

1 participant