[PR #4245] [GUI] Add opt-in answerer for the agent's ask_user_question events #4970

Open
opened 2026-11-07 16:31:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4245
Author: @devplex69
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: ask-user-answerer


📝 Commits (1)

  • 134ccdd [GUI] give the agent's own questions an answerer surface (opt-in)

📊 Changes

8 files changed (+222 additions, -10 deletions)

View changed files

📝 apps/host/server/agent/agent-bridge.mjs (+49 -3)
📝 apps/host/server/agent/gateway-client.mjs (+7 -3)
📝 apps/host/server/agent/preset.mjs (+6 -1)
📝 apps/host/server/agent/profile.mjs (+2 -2)
📝 apps/host/server/agent/tools-settings.mjs (+5 -0)
➕ apps/host/server/agent/user-questions.mjs (+50 -0)
📝 apps/host/server/index.mjs (+16 -1)
➕ apps/host/tests/user-questions.test.mjs (+87 -0)

📄 Description

Draft PR. Scope issue: #4244.

Problem

The host bridge auto-dismisses the Harness's user-questions/request event with outcome:'next', so the agent can never actually ask the user a question mid-run — a capability Qoder / OpenAI Codex desktop / Claude desktop all have. See #4244 for the full scope discussion.

Approach

An opt-in answerer that reuses the existing approval round-trip. The default path is byte-identical: the askUserQuestions toggle defaults to false, and when off, questions are still auto-dismissed exactly as before.

  • apps/host/server/agent/user-questions.mjs (new): adapter isolating the two unconfirmed Harness wire-shapes (parseQuestions, answerWire).
  • apps/host/server/agent/gateway-client.mjs: answerEvent now carries an optional structured value (backward-compatible — outcome:'next' still sends {kind:'next'}).
  • apps/host/server/agent/agent-bridge.mjs: askUser flag, pendingQuestions map, questionsFor(chatId), answerQuestion(...).
  • apps/host/server/agent/preset.mjs, profile.mjs, tools-settings.mjs: askUserQuestions toggle; the tool-ask-user plugin is added only when it is on.
  • apps/host/server/index.mjs: GET /api/agent/pending returns questions only when non-empty; new POST /api/chat/answer.
  • apps/host/tests/user-questions.test.mjs (new): 5 harness-free pure tests.

Validation

Passed

  • npm test in apps/host — 5 new pure tests plus the existing preset drift test, all green.

Failed

  • None.

Not run

  • End-to-end against a live DeepSeek Harness (no STRATA_HARNESS_DIR here). This is the reason the PR is kept as a draft.

Limits

Two parts of the Harness wire contract are unconfirmed static analysis (the pinned Harness is not in this repo):

  1. the $events/result answer payload shape (I send { answers: [{ question, answer }] });
  2. the ask-user plugin id (@deepseek-ai/dsh-tool-ask-user).

Both are isolated in user-questions.mjs so each is a one-line fix once a maintainer confirms the real shape. No React question-card UI is included yet — the endpoint and round-trip are in place; the front-end surface is a follow-up.


🔄 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/Niko1221/Strata/pull/4245 **Author:** [@devplex69](https://github.com/devplex69) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ask-user-answerer` --- ### 📝 Commits (1) - [`134ccdd`](https://github.com/Niko1221/Strata/commit/134ccdd11a2b405765dfba03425f521f0f5b65e6) [GUI] give the agent's own questions an answerer surface (opt-in) ### 📊 Changes **8 files changed** (+222 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/agent/agent-bridge.mjs` (+49 -3) 📝 `apps/host/server/agent/gateway-client.mjs` (+7 -3) 📝 `apps/host/server/agent/preset.mjs` (+6 -1) 📝 `apps/host/server/agent/profile.mjs` (+2 -2) 📝 `apps/host/server/agent/tools-settings.mjs` (+5 -0) ➕ `apps/host/server/agent/user-questions.mjs` (+50 -0) 📝 `apps/host/server/index.mjs` (+16 -1) ➕ `apps/host/tests/user-questions.test.mjs` (+87 -0) </details> ### 📄 Description Draft PR. Scope issue: #4244. ## Problem The host bridge auto-dismisses the Harness's `user-questions/request` event with `outcome:'next'`, so the agent can never actually ask the user a question mid-run — a capability Qoder / OpenAI Codex desktop / Claude desktop all have. See #4244 for the full scope discussion. ## Approach An opt-in answerer that reuses the existing approval round-trip. The default path is byte-identical: the `askUserQuestions` toggle defaults to `false`, and when off, questions are still auto-dismissed exactly as before. - `apps/host/server/agent/user-questions.mjs` (new): adapter isolating the two unconfirmed Harness wire-shapes (`parseQuestions`, `answerWire`). - `apps/host/server/agent/gateway-client.mjs`: `answerEvent` now carries an optional structured `value` (backward-compatible — `outcome:'next'` still sends `{kind:'next'}`). - `apps/host/server/agent/agent-bridge.mjs`: `askUser` flag, `pendingQuestions` map, `questionsFor(chatId)`, `answerQuestion(...)`. - `apps/host/server/agent/preset.mjs`, `profile.mjs`, `tools-settings.mjs`: `askUserQuestions` toggle; the `tool-ask-user` plugin is added only when it is on. - `apps/host/server/index.mjs`: `GET /api/agent/pending` returns `questions` only when non-empty; new `POST /api/chat/answer`. - `apps/host/tests/user-questions.test.mjs` (new): 5 harness-free pure tests. ## Validation **Passed** - `npm test` in `apps/host` — 5 new pure tests plus the existing preset drift test, all green. **Failed** - None. **Not run** - End-to-end against a live DeepSeek Harness (no `STRATA_HARNESS_DIR` here). This is the reason the PR is kept as a **draft**. ## Limits Two parts of the Harness wire contract are **unconfirmed static analysis** (the pinned Harness is not in this repo): 1. the `$events/result` answer payload shape (I send `{ answers: [{ question, answer }] }`); 2. the ask-user plugin id (`@deepseek-ai/dsh-tool-ask-user`). Both are isolated in `user-questions.mjs` so each is a one-line fix once a maintainer confirms the real shape. No React question-card UI is included yet — the endpoint and round-trip are in place; the front-end surface is a follow-up. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4970
No description provided.