Skip to content

feat(cloud-agents): add no-repo mode, fix session init race, enable follow-ups after cloud run#1294

Open
tatoalo wants to merge 1 commit intomainfrom
feat/cloud-agents/no-repo-flow-and-followup-relay
Open

feat(cloud-agents): add no-repo mode, fix session init race, enable follow-ups after cloud run#1294
tatoalo wants to merge 1 commit intomainfrom
feat/cloud-agents/no-repo-flow-and-followup-relay

Conversation

@tatoalo
Copy link
Contributor

@tatoalo tatoalo commented Mar 18, 2026

Problem

  1. race condition: SSE connection and autoInitializeSession() can both call initializeSession() concurrently, creating duplicate sessions and sending the initial prompt twice (duplicate Slack messages)
  2. follow-up replies not delivered: after a follow-up prompt completes, the agent response was not being relayed back to Slack thread
  3. chat input disabled: PR feat: Add multi-agent command center grid view #1212 re-introduced readOnlyMessage and changed isRunning to be false when cloud run is terminal, blocking the editor after task completion so reverted to the fix introduced last week

Changes

  • added initializationPromise lock to prevent concurrent session creation, with pendingEvents buffer that replays SSE events after the session attaches
  • affter end_turn on follow-ups and resumes, call relayAgentResponse() to post the agent's reply to Slack
  • add currentTurnMessages tracking in SessionLogWriter with getFullAgentResponse() and resetTurnMessages() for accurate per-turn message extraction
  • added "No Repository Mode" system prompt for cloud tasks without a connected repo (slack and ph-ai backbone)

@tatoalo tatoalo self-assigned this Mar 18, 2026
@tatoalo tatoalo force-pushed the feat/cloud-agents/no-repo-flow-and-followup-relay branch from 3cf0aaf to 06dd80c Compare March 18, 2026 18:00
const sandboxContext = this.resumeState.snapshotApplied
? `The sandbox environment (all files, packages, and code changes) has been fully restored from a snapshot.`
: `The sandbox could not be restored from a snapshot (it may have expired). You are starting with a fresh environment but have the full conversation history below.`;
? `The workspace environment (all files, packages, and code changes) has been fully restored from where you left off.`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

felt cleaner but can revert it tho

@tatoalo tatoalo marked this pull request as ready for review March 19, 2026 08:48
@tatoalo tatoalo requested review from a team March 19, 2026 08:49
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.

2 participants