[Bug][Workspace] 阻止空上下文 Agent Handoff #8

Closed
opened 2026-09-15 00:52:29 +08:00 by CoderLambert · 2 comments
CoderLambert commented 2026-09-15 00:52:29 +08:00 (Migrated from github.com)

Execution State

READY

Observed base: main@51a3112
Execution base: latest main

Problem

Compare 尚未收集到任何有效回答时,Send Agent 仍然可以执行,目标 Provider 收到的只是空上下文和未收集占位信息。

Target

只有至少一个有效 response snapshot 时,Workspace 才允许发送 Agent Handoff;无有效回答时给出明确提示,并保持当前工作区状态不变。

Invariants

  • 不改变 Handoff 消息协议和 Provider 页面架构。
  • 不丢弃已经收集的有效回答。
  • 不增加权限或持久化回答内容。
  • 失败 Provider 不应阻止使用其他成功 Provider 的结果进行 Handoff。

Acceptance Criteria

  • 没有有效回答时 Send Agent 不发送请求。
  • 没有有效回答时显示先执行 Compare 的提示。
  • 至少一个 Provider 成功时允许 Handoff。
  • 失败 Provider 的错误不会覆盖成功 Provider 的上下文。

Validation

Focused:

  • 待执行 workspace 静态检查

Repository / Regression:

  • 按用户要求暂缓完整测试

Dependencies

Hard blocked by:

  • none

Conflict / shared surfaces

  • workspace handoff state only
## Execution State READY Observed base: main@51a3112 Execution base: latest main ## Problem Compare 尚未收集到任何有效回答时,Send Agent 仍然可以执行,目标 Provider 收到的只是空上下文和未收集占位信息。 ## Target 只有至少一个有效 response snapshot 时,Workspace 才允许发送 Agent Handoff;无有效回答时给出明确提示,并保持当前工作区状态不变。 ## Invariants - 不改变 Handoff 消息协议和 Provider 页面架构。 - 不丢弃已经收集的有效回答。 - 不增加权限或持久化回答内容。 - 失败 Provider 不应阻止使用其他成功 Provider 的结果进行 Handoff。 ## Acceptance Criteria - [ ] 没有有效回答时 Send Agent 不发送请求。 - [ ] 没有有效回答时显示先执行 Compare 的提示。 - [ ] 至少一个 Provider 成功时允许 Handoff。 - [ ] 失败 Provider 的错误不会覆盖成功 Provider 的上下文。 ## Validation Focused: - 待执行 workspace 静态检查 Repository / Regression: - 按用户要求暂缓完整测试 ## Dependencies Hard blocked by: - none ## Conflict / shared surfaces - workspace handoff state only
CoderLambert commented 2026-09-15 00:54:35 +08:00 (Migrated from github.com)

Status: In Progress

Progress

  • Prevent handoff when no model is selected
  • Prevent handoff when no selected provider has a successful non-empty response snapshot
  • Preserve partial-success handoff behavior

Changes

  • Added a workspace guard before target selection/storage mutation and before the send request.
  • Valid snapshots accept collected text from either response.content or response.markdown.

Commit

909e7dc

Tests

  • node --check apps/browser-extension/workspace/workspace.js passed
  • git diff --check passed
  • Full test suite and browser validation deferred by request

Known Limitations

  • Issue remains open until the deferred checks are run.
Status: In Progress ## Progress - [x] Prevent handoff when no model is selected - [x] Prevent handoff when no selected provider has a successful non-empty response snapshot - [x] Preserve partial-success handoff behavior ## Changes - Added a workspace guard before target selection/storage mutation and before the send request. - Valid snapshots accept collected text from either `response.content` or `response.markdown`. ## Commit 909e7dc ## Tests - `node --check apps/browser-extension/workspace/workspace.js` passed - `git diff --check` passed - Full test suite and browser validation deferred by request ## Known Limitations - Issue remains open until the deferred checks are run.
CoderLambert commented 2026-09-15 01:01:31 +08:00 (Migrated from github.com)

[CLOSURE]

Merged commit: 909e7dc

Acceptance Criteria:

  • complete
  • Browser Smoke confirms an empty comparison cannot trigger Agent Handoff.
  • The guard checks selected providers only, so successful snapshots remain usable when another Provider fails.

Validation:

Scope deviation:

  • NONE

Security/permission delta:

  • NONE

Follow-ups:

  • NONE
[CLOSURE] Merged commit: 909e7dc Acceptance Criteria: - complete - Browser Smoke confirms an empty comparison cannot trigger Agent Handoff. - The guard checks selected providers only, so successful snapshots remain usable when another Provider fails. Validation: - focused: PASS (`node --check apps/browser-extension/workspace/workspace.js`) - repository/regression: PASS (CI run https://github.com/CoderLambert/ai-parallel/actions/runs/34872040678) - browser: PASS (Browser Smoke run https://github.com/CoderLambert/ai-parallel/actions/runs/34872040637) - required CI: PASS Scope deviation: - NONE Security/permission delta: - NONE Follow-ups: - NONE
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lambert/ai-parallel#8