Skip to content

fix(tasks): expand latest plan after cloud resume - #3771

Closed
puemos wants to merge 3 commits into
mainfrom
posthog-code/expand-latest-replayed-plan
Closed

fix(tasks): expand latest plan after cloud resume#3771
puemos wants to merge 3 commits into
mainfrom
posthog-code/expand-latest-replayed-plan

Conversation

@puemos

@puemos puemos commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

When a cloud task reconnects with a plan as its latest useful output, history replay marks the plan as historical and the UI folds it. Plan-mode inactivity cleanup can also close ACP before the pending plan prompt settles, persisting a misleading connection error in the thread.

Why: Resuming an interrupted task should preserve the result the user was last working from without surfacing an intentional shutdown as a task failure.

Changes

  • Expand only the final historical plan during replay.
  • Settle active plan prompts before closing ACP during session cleanup.

How did you test this?

  • pnpm --filter @posthog/agent exec vitest run src/server/agent-server.test.ts
  • pnpm --filter @posthog/agent typecheck
  • pnpm exec biome check packages/agent/src/server/agent-server.ts packages/agent/src/server/agent-server.test.ts
  • Existing plan replay tests and typechecks from the earlier commits.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 25730fa1-b212-4cb9-a1c2-31322da96702
@trunk-io

trunk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 2d8b487.

puemos added 2 commits July 23, 2026 21:47
Generated-By: PostHog Code
Task-Id: 25730fa1-b212-4cb9-a1c2-31322da96702
Generated-By: PostHog Code
Task-Id: 25730fa1-b212-4cb9-a1c2-31322da96702
@puemos puemos closed this Jul 28, 2026
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