Skip to content

fix(agent): continue cloud tasks after compaction#3463

Merged
tatoalo merged 4 commits into
mainfrom
posthog-code/fix-cloud-compact-continuation
Jul 15, 2026
Merged

fix(agent): continue cloud tasks after compaction#3463
tatoalo merged 4 commits into
mainfrom
posthog-code/fix-cloud-compact-continuation

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Manual /compact commands in cloud tasks complete the compaction turn and leave the agent idle instead of continuing the task.

Closes #3373

Changes

  • treat manual /compact as an intermediate cloud turn.
  • send a hidden follow-up prompt so the agent continues from the compacted context before the turn is reported complete

Treat manual /compact commands as an intermediate cloud turn and send a hidden continuation prompt before reporting completion.

Add a regression test covering compact commands with continuation instructions.

Generated-By: PostHog Code
Task-Id: 233a983e-daa3-4d81-af56-bb43488687ab
@trunk-io

trunk-io Bot commented Jul 15, 2026

Copy link
Copy Markdown

😎 Merged manually by @tatoalo - details.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 80033e6.

Document why cloud compaction needs a hidden follow-up and assert the command returns the continuation turn's final stop reason.

Generated-By: PostHog Code
Task-Id: 233a983e-daa3-4d81-af56-bb43488687ab
@tatoalo tatoalo self-assigned this Jul 15, 2026
@tatoalo tatoalo marked this pull request as ready for review July 15, 2026 11:19
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "test(agent): strengthen compact continua..." | Re-trigger Greptile

Comment thread packages/agent/src/server/agent-server.ts Outdated
Comment thread packages/agent/src/server/agent-server.ts Outdated
@tatoalo tatoalo requested a review from a team July 15, 2026 11:21
Suppress intermediate adapter turn-complete notifications until the compact continuation finishes.

Track pending continuations by message ID so redelivery retries only the continuation after a failure instead of compacting again.

Generated-By: PostHog Code
Task-Id: 233a983e-daa3-4d81-af56-bb43488687ab
@tatoalo tatoalo enabled auto-merge (squash) July 15, 2026 11:34
@tatoalo tatoalo merged commit dc71243 into main Jul 15, 2026
30 checks passed
@tatoalo tatoalo deleted the posthog-code/fix-cloud-compact-continuation branch July 15, 2026 11:44
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.

Compacting stops the conversation

2 participants