Skip to content

refactor: simplify model-facing coding surface - #172

Closed
Waishnav wants to merge 1 commit into
mainfrom
codex/model-facing-interface
Closed

refactor: simplify model-facing coding surface#172
Waishnav wants to merge 1 commit into
mainfrom
codex/model-facing-interface

Conversation

@Waishnav

@Waishnav Waishnav commented Aug 9, 2026

Copy link
Copy Markdown
Owner

DevSpace's runtime model-facing contract now favors actionable choices and concise outcomes while keeping tooling mechanics behind the server. Tool descriptions, server instructions, workspace/process/artifact responses, and lifecycle text are shorter; provider and runtime diagnostics plus process tuning remain managed by DevSpace.

Verified with npm run typecheck, npm test, and npm run build.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

DevSpace now presents a concise workspace-scoped product model. MCP tool schemas and workspace results expose less internal metadata. Codex process controls use reduced inputs. Documentation and tests describe the revised contracts.

Changes

Workspace-scoped interface refinement

Layer / File(s) Summary
Product model and documentation guidance
AGENTS.md, README.md, docs/*, examples/agents/*, package.json, src/cli.ts, src/oauth-provider.ts
Documentation now uses workspace-scoped terminology, defines interface and security boundaries, and removes unnecessary local-environment details.
MCP contracts and delegation flow
skills/subagent-delegation/SKILL.md, src/artifact-tools.ts, src/server.ts
Tool descriptions, workspace output, Codex process inputs and results, shell handling, artifact guidance, and agent profile selection now use reduced model-facing contracts.
Server contract validation
src/server.test.ts
Tests validate the revised server metadata, workspace and agent payloads, Codex schemas, reuse messages, and configurable tool modes.

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

Possibly related PRs

  • Waishnav/devspace#26: Introduced the Codex tool mode refined by these schema and process changes.
  • Waishnav/devspace#55: Overlaps with the subagent profile and delegation contract changes.
  • Waishnav/devspace#88: Introduced the native artifact download contract refined by these documentation and tool-description changes.

Poem

A rabbit reviews the workspace bright,
Short tools guide the model right.
Handles hide, profiles show,
Codex waits with less to know.
Tests keep every contract tight.

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: simplifying DevSpace’s model-facing coding surface.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/model-facing-interface

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 Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

The PR simplifies DevSpace’s model-facing language and schemas while moving process, provider, and diagnostic choices behind the server.

  • Rewrites product guidance and documentation around project/workspace terminology and audience boundaries.
  • Reduces workspace and agent metadata exposed to models.
  • Removes process timing, output-budget, and PTY-dimension controls from Codex-mode tools.
  • Shortens server instructions, tool descriptions, CLI copy, and lifecycle responses.

Confidence Score: 4/5

The process-output recovery defect should be fixed before merging because completed high-output commands direct callers to a session that no longer exists.

Truncated process output is irreversibly discarded, yet the changed response instructs callers to retrieve more through write_stdin; completed sessions have already been deleted, so that follow-up fails.

Files Needing Attention: src/server.ts

Important Files Changed

Filename Overview
src/server.ts Simplifies model-facing schemas and responses, but the new truncation guidance promises recovery that the process-session lifecycle cannot provide.
src/server.test.ts Adds coverage for the reduced workspace and process schemas but omits completed-command truncation behavior.
skills/subagent-delegation/SKILL.md Updates delegation guidance to select configured profiles without exposing provider-specific controls.
AGENTS.md Reframes repository guidance around concise model-facing outcomes, product vocabulary, and hidden implementation mechanics.
docs/chatgpt-coding-workflow.md Relabels the workflow as an integration reference and documents the reduced agent and process surfaces.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[exec_command starts process] --> B[Wait using internal yield limit]
  B --> C[Drain bounded output snapshot]
  C --> D{Output truncated?}
  D -- No --> E[Return command status and output]
  D -- Yes --> F[Discard omitted middle]
  F --> G{Process still running?}
  G -- Yes --> H[write_stdin can read only newly produced output]
  G -- No --> I[Delete process session]
  I --> J[Suggested write_stdin call fails as unknown session]
Loading

Reviews (1): Last reviewed commit: "refactor: simplify model-facing coding s..." | Re-trigger Greptile

Comment thread src/server.ts
Comment on lines +473 to +474
const outputNote = snapshot.outputTruncated
? " Output is partial; continue with write_stdin for more."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Truncated output recovery is broken

When a command exceeds the fixed output budget, this response tells the caller to retrieve more through write_stdin, but draining the snapshot has already discarded the omitted output; when the command has completed, its session has also been deleted, so the suggested follow-up fails with Unknown process session.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/server.ts (1)

490-515: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove internal diagnostics from card metadata too.

The reduced structuredContent contracts are incomplete. _meta.card.summary still receives wallTimeMs from Lines 570-576 and Lines 612-618. _meta.card still includes agentProviders, providerAvailable, and providerUnavailableReason from Lines 744-752 and Lines 819-828.

Remove these fields from card metadata. Add integration assertions that card metadata excludes timing and provider diagnostics.

  • src/server.ts#L490-L515: remove wallTimeMs from the process card summaries.
  • src/server.ts#L766-L843: remove provider availability and provider diagnostic fields from the workspace card payload.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/server.ts` around lines 490 - 515, Update src/server.ts lines 490-515 in
processToolResponse and the process-card summary paths at lines 570-576 and
612-618 to exclude wallTimeMs from _meta.card.summary; update the workspace card
payload at lines 766-843 to remove agentProviders, providerAvailable, and
providerUnavailableReason. Add integration assertions covering both card
metadata paths to verify timing and provider diagnostics are absent.

Sources: Coding guidelines, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/setup.md`:
- Around line 46-50: Update the label in the Server Port section before the
loopback URL from “The MCP URL” to “The server listens at,” leaving the URL and
subsequent public client endpoint guidance unchanged.

In `@README.md`:
- Around line 146-148: Update the DevSpace description in the README to use
complete product-oriented wording: state that DevSpace provides remote access to
selected project folders, while preserving the surrounding explanation.

---

Outside diff comments:
In `@src/server.ts`:
- Around line 490-515: Update src/server.ts lines 490-515 in processToolResponse
and the process-card summary paths at lines 570-576 and 612-618 to exclude
wallTimeMs from _meta.card.summary; update the workspace card payload at lines
766-843 to remove agentProviders, providerAvailable, and
providerUnavailableReason. Add integration assertions covering both card
metadata paths to verify timing and provider diagnostics are absent.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e743c263-820f-41b0-bb3d-9363560a0a32

📥 Commits

Reviewing files that changed from the base of the PR and between 3bd0378 and d196a71.

📒 Files selected for processing (16)
  • AGENTS.md
  • README.md
  • docs/artifact-exchange.md
  • docs/chatgpt-coding-workflow.md
  • docs/configuration.md
  • docs/gotchas.md
  • docs/security.md
  • docs/setup.md
  • examples/agents/codex-qa-tester.md
  • package.json
  • skills/subagent-delegation/SKILL.md
  • src/artifact-tools.ts
  • src/cli.ts
  • src/oauth-provider.ts
  • src/server.test.ts
  • src/server.ts

Comment thread docs/setup.md Outdated
Comment on lines +46 to +50
### Server Port

The default is `7676`.

The local MCP URL is:
The MCP URL is:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Distinguish the server listener from the client endpoint.

The text labels http://127.0.0.1:7676/mcp as “The MCP URL.” This is the server's loopback listener. The public client endpoint appears later in the guide. Rename this label to “The server listens at” so users do not configure a remote MCP client with the loopback URL.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/setup.md` around lines 46 - 50, Update the label in the Server Port
section before the loopback URL from “The MCP URL” to “The server listens at,”
leaving the URL and subsequent public client endpoint guidance unchanged.

Comment thread README.md Outdated
Comment on lines +146 to +148
DevSpace is remote access to selected project folders.

You decide which roots are allowed. The MCP client still has powerful local
You decide which roots are allowed. The MCP client still has powerful coding

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a complete product description.

DevSpace is remote access to selected project folders describes a capability as if it were the product. Use DevSpace provides remote access to selected project folders. This wording is clearer for users.

🧰 Tools
🪛 LanguageTool

[grammar] ~148-~148: Ensure spelling is correct
Context: ...cted project folders. You decide which roots are allowed. The MCP client still has p...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 146 - 148, Update the DevSpace description in the
README to use complete product-oriented wording: state that DevSpace provides
remote access to selected project folders, while preserving the surrounding
explanation.

@Waishnav
Waishnav force-pushed the codex/model-facing-interface branch from d196a71 to 5281bfb Compare August 9, 2026 16:11
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