[PR #1300] [MERGED] fix(headless): respect mode passed to /message endpoint #9882

Closed
opened 2026-02-16 18:14:19 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1300
Author: @kehanzhang
Created: 7/25/2025
Status: Merged
Merged: 7/25/2025
Merged by: @thdxr

Base: devHead: dev


📝 Commits (1)

  • daaeae1 mode gets overwritten and defaults to build in headless server

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/opencode/src/session/index.ts (+1 -0)

📄 Description

The headless server was overwriting the incoming mode on POST /message and always using build.

Change: use the provided mode if present; fall back to build only when not set.

Tested locally: sending { mode: "plan" } now runs in plan mode; the agent on the current build uses bash to bypass write tools being gated as the system prompt is inconsistent.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1300 **Author:** [@kehanzhang](https://github.com/kehanzhang) **Created:** 7/25/2025 **Status:** ✅ Merged **Merged:** 7/25/2025 **Merged by:** [@thdxr](https://github.com/thdxr) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`daaeae1`](https://github.com/anomalyco/opencode/commit/daaeae1a7750550c4657928c7dc6179f608cf613) mode gets overwritten and defaults to build in headless server ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/session/index.ts` (+1 -0) </details> ### 📄 Description The headless server was overwriting the incoming `mode` on POST /message and always using `build`. Change: use the provided `mode` if present; fall back to `build` only when not set. Tested locally: sending { mode: "plan" } now runs in plan mode; the agent on the current build uses bash to bypass write tools being gated as the system prompt is inconsistent. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:19 -05:00
yindo closed this issue 2026-02-16 18:14:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9882