Skip to content

fix(runtime): preserve Plan final responses - #3886

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Sun-GLiang:fix/3884-plan-final-response
Aug 29, 2026
Merged

fix(runtime): preserve Plan final responses#3886
Astro-Han merged 1 commit into
apache:mainfrom
Sun-GLiang:fix/3884-plan-final-response

Conversation

@Sun-GLiang

Copy link
Copy Markdown
Contributor

Plan execution completion is a tool boundary, not a conversational terminal. Stop setting the agent-loop stop flag for completed and cancelled Plan executions so the model can consume the durable result and produce a final response.

Keep SubmitPlan as the explicit one-step plan_handoff, and cover completion, cancellation, and submission boundaries with provider-loop regressions.

Fixes#3884

Verification

  • npm --workspace @maka/runtime run typecheck
  • npm --workspace @maka/runtime run build
  • node --test packages/runtime/dist/__tests__/ai-sdk-backend.test.js — 202/202 passed
  • npx biome check packages/runtime/src/ai-sdk-backend.ts packages/runtime/src/__tests__/ai-sdk-backend.test.ts
  • git diff --check

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka investigated the Runtime Plan terminal path, implemented the loop-boundary change, and authored the regression coverage and PR text. The commit includes a Generated-by: Maka trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — completed or cancelled Plan executions now allow the model's final response; Plan submission still hands off for approval
  • No

@M4n5ter
M4n5terforce-pushed the fix/3884-plan-final-response branch 2 times, most recently from 14d2fc0 to 13157afCompareAugust 26, 2026 09:44
Treat completed and cancelled Plan executions as tool boundaries so the model can consume the durable result and produce its final response. Keep SubmitPlan as the explicit approval handoff.
Generated-by: Maka
@M4n5ter
M4n5terforce-pushed the fix/3884-plan-final-response branch from 13157af to 080ef8cCompareAugust 26, 2026 09:51
@github-actionsgithub-actionsBot added the effort/M Under 500 readable lines label Aug 27, 2026

@Astro-HanAstro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused fix. The Plan result was already durable, but plan_execution_completed and cancelled still stopped the provider loop before it could produce the final response. Removing that stop behavior at the existing Plan tool boundary addresses the root cause without moving PlanStore authority or adding another state.

The SubmitPlan handoff behavior remains unchanged, and the regression coverage plus exact-head CI support the intended continuation behavior.

Reviewed with Codex and an independent @Reviewer agent. I verified the problem path, Plan/Turn ownership boundary, focused diff, and passing CI.

中文对照

谢谢你做了这个聚焦的修复。Plan 结果已经持久化,但 plan_execution_completedcancelled 仍会提前停止 provider loop,导致最终回复无法生成。在既有 Plan tool 边界移除这两个 stop 行为,直接解决了根因,也没有移动 PlanStore 的 authority 或增加新状态。

SubmitPlan 的 handoff 行为保持不变,回归测试和精确 head 的 CI 也支持预期的 continuation 行为。

本次审查使用了 Codex 和一个独立的 @Reviewer 子代理;我核对了问题路径、Plan/Turn 职责边界、聚焦 diff 和 CI 结果。

@Astro-Han
Astro-Han merged commit 82b36dc into apache:mainAug 29, 2026
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/MUnder 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(runtime): Plan execution completes without a final assistant response

2 participants

@Sun-GLiang@Astro-Han