Skip to content

feat(first-session): a new pod opens with two next steps, connect an agent here or invite a teammate - #2218

Merged
lilyshen0722 merged 1 commit into
mainfrom
growth/scout-new-pod-next-steps
Oct 15, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
growth/scout-new-pod-next-steps

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

When Scout creates a pod on approval, the pod's first message is now Scout offering two starts, server-composed the #2194 way:

  • Connect an agent to this pod opens Bring your own aimed at that pod (/v2/agents/byo?pod=<new>&name=<username>-agent).
  • Invite a teammate opens that pod's own invite dialog.

Why

The proposer's free-text reply after create_pod pointed only at the task board. On 10-15 the first outside signup from outreach clicked "Start a pod for a project", had a pod within a minute, and stopped right there: no agent, no second person. A pod becomes a team only when both arrive, and the goal through 11-01 counts teams (2+ people, 2+ agent vendors). So every new pod now gets one click to an agent of its own and one click to a second person.

Changes

  • approvalActionService: after a successful create_pod where the agent joined, post the starts message into the new pod. It's never fatal: the pod exists either way, and the result records nextStepsPosted. The approval cue tells the proposer the steps are already posted, so its reply is one line pointing at the pod, not a list.
  • Starts can act instead of sending text:
    • href navigates. In-app /v2/ paths only; protocol-relative, absolute, /v2//… and backslash forms are never rendered.
    • action: 'invite' opens the invite dialog on the people tab. It only shows where the thread can open the dialog.
    • Plain starts behave exactly as before: they send their label as the person's message, and a start goes away once the person has sent it.
  • Scout's prompt: one line saying the new pod already shows its next steps.

The seat name comes from suggestLocalAgentName('agent', owner), so it's free and built from the owner's username (#2180). If no free name is found, the link omits name= and the page asks where to run.

Tests

  • approvalActionService.test.js:
    • the new pod gets exactly these two starts;
    • the connect link is aimed at the new pod, never the approving pod;
    • a failed post leaves the decision and pod intact, with nextStepsPosted: false;
    • an agent that couldn't join posts nothing.
  • approvalActionService.proposerWake.test.js: the cue says the steps are posted, only when they were.
  • V2ThreadStarts.test.tsx, 5 new tests:
    • the connect start navigates and sends no message;
    • the invite start opens the dialog on people and sends no message;
    • both starts stay after use;
    • no invite start where the dialog can't open;
    • links that leave the app, and unknown actions, are never rendered.
  • Mutations, each caught:
    • letting any href through fails the leave-the-app test;
    • a no-op navigate fails the navigate test;
    • skipping the server post fails 2 backend tests.
  • Ran locally:
    • backend (approval, proposer-wake, Scout knowledge, welcome suites): 40/40;
    • frontend (starts, starter, invite modal): 29/29;
    • eslint: 0 errors and no new warnings;
    • frontend tsc --noEmit: clean.

After deploy: Growth runs a fresh-account check on production (signup → "Start a pod for a project" → approve → the new pod shows both buttons → each one does its job) and posts the result here.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ajWuL8XiGBSHWiurjqm7B

…agent here or invite a teammate

When Scout creates a pod on approval, the pod's first message is now Scout
offering two starts, server-composed the #2194 way:
- "Connect an agent to this pod" opens Bring your own aimed at THAT pod
  (/v2/agents/byo?pod=<new>&name=<username>-agent);
- "Invite a teammate" opens the pod's own invite dialog.

Before this, the proposer's free-text reply pointed only at the task board.
The first outside signup from outreach (10-15) took "Start a pod for a
project", got a pod in under a minute, and stopped right there: no agent, no
second person. A pod becomes a team when both arrive.

- approvalActionService: after a successful create_pod and agent join, post
  the starts message into the new pod (never fatal; the result records
  nextStepsPosted). The approval cue tells the proposer the steps are already
  posted, so its reply is one line pointing at the pod.
- Starts can now act instead of sending text: `href` navigates (in-app /v2/
  paths only; anything else is never rendered) and `action: 'invite'` opens
  the invite dialog (shown only where the thread can open it). Plain starts
  still send their label as the person's message.
- Scout's prompt: one line on what happens after create_pod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018ajWuL8XiGBSHWiurjqm7B

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Security and code review at b72540a (eng lead).

Who can author a navigating start: only the server.

  • A message's payload is written only by server code: Scout's welcome (authController) and the approval service (cards, plus these next steps).
  • None of the three client write paths reads a payload:
    • the human route takes { content, text, attachments, replyToMessageId, threadRootId };
    • the runtime post takes { content, metadata, messageType }, and nothing anywhere derives a payload from metadata;
    • the socket path takes no payload.

So a BYO agent in the pod can't forge a starts button, and the client allowlist is defence in depth rather than the boundary.

The allowlist holds:

  • /^\/v2\/[^/\\]/ refuses //host, https://…, /v2//host, a backslash after /v2/, an empty string, null, and non-strings (which stringify and fail).
  • navigate() is same-origin by construction (pushState can't change origin), so an encoded or .. path still lands on an in-app route.
  • The server builds the href with encodeURIComponent on both the pod id and the seat name.
  • A mutation making the check always true fails a start whose link leaves the app is never rendered.

The invite action renders only where the thread can open the dialog, and the invite itself stays server-authorised. Read-only threads get no start handler at all.

Never fatal: postNewPodNextSteps catches and returns false, nextStepsPosted records it, and the approval cue mentions the buttons only when they were posted. It posts only when the proposer joined the pod, so the post can't 403.

Checked at this head:

  • backend approval, proposer-wake, Scout and welcome suites: 4 suites, 58/58;
  • frontend starts, starter and the four invite suites: 6 suites, 38/38;
  • frontend tsc 0; 0 CodeQL alerts.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit cfe91c2 Oct 15, 2026
17 checks passed
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Production check: PASS. Live on cfe91c21; backend and frontend pods started 2026-10-15T13:47:42Z. Fresh account eng-smoke-newpod-1015, created 14:35:38Z (after the cutover), in a clean browser at 1440 px.

Step Result
Welcome → "Start a pod for a project" Scout asked for the project within the 40 s polling window
"A docs site for our CLI" → create-pod card → Approve (14:36:02.7Z) Pod cli-docs created
Scout's reply in My Workspace "Done — 'cli-docs' is live in your pod list. Open it and pick one of the two buttons waiting there to keep going." (one line, as the new cue asks)
New pod's first message (14:36:04.3Z, ~1.7 s after approve) Scout, payload.kind: 'starts': Connect an agent to this pod (href: /v2/agents/byo?pod=<cli-docs>&name=eng-smoke-newpod-101-agent) and Invite a teammate (action: 'invite')
1a. Connect Lands on /v2/agents/byo?pod=<cli-docs>&name=…. Install into pod = "cli-docs (chat)" (not My Workspace), name prefilled, Bring your own runtime pressed
1b. Invite Opens "Invite to cli-docs" on the Invite people tab (Generate invite link shown)
2. No chat message from either button Authors in the pod after both clicks: Scout only. The person posted nothing
3. Both buttons stay after use Present after Connect, and present after Invite

Screenshots are kept locally (connect → BYO, invite dialog, buttons after use).

One observation, not from this PR: the suggested seat name cuts a long username mid-word (eng-smoke-newpod-1015 → eng-smoke-newpod-101-agent). SRE saw the same on the stranger journey (eng-smoke-journey-10-eng-smoke-claude). It comes from suggestLocalAgentName's username slug cap (#2180). Real usernames are usually short, so it's cosmetic. Reported to CTO separately.

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