Ux/all hands demo july 13 2026#3387
Conversation
Reworks the create-context dialog into a plan-mode launcher and gives the context index a real feed of "PostHog agent" system messages. Create dialog (quill Dialog): asks for a name + a description of what the context is about, then launches a cloud plan-mode session that investigates the repo and PostHog and co-builds CONTEXT.md with the user (buildContextGenerationPrompt seeds it with the description). Resolves adapter/model like the composer so cloud runs aren't rejected, and owns the task on the backend channel so it lands in the context feed (not just Recents). On failure the context is kept and the typed description is preserved for the next attempt. Context feed: after launch you land on the context index, where durable, team- visible announcements render alongside the plan task card — "created this context" (server-emitted channel_created) then "is building CONTEXT.md" (context_md_building), in order, then the card you click into for the session. Backed by the new ChannelFeedMessage endpoint (posthog/posthog); ordered via explicit timestamps. Removes the old fire-and-forget generation-task tracking (setGenerationTask / useFolderGenerationTask / GeneratingState + polling); the empty-state "Build with agent" now opens the same describe-and-plan dialog. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The feed-message endpoint (posthog#70320) isn't deployed, so the feed opened with the plan-task card instead of a creation announcement. Synthesize the opener from TaskChannel.created_at/created_by — canonical, always sorts first, deploy-independent — and filter server-emitted channel_created/context_created rows so nothing duplicates once the backend lands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Resolve the cloud model via modelResolver.resolveDefaultModel (like the freeform-canvas flow) instead of trusting the composer picker's async state; hard-stop with a toast when no model resolves, before the task (and orphaned context) is created. - Stop polling the channel feed once the query errors and disable retries — the endpoint 404s on prod until posthog#70320 deploys, and the old numeric interval + default retries streamed ~4 requests per 5s forever. - Make the feed merge comparator consistent for equal timestamps. - Only consume the stashed create-dialog description in create mode, so the describe-mode open the failed-launch flow lands on doesn't wipe it. - Narrow ChannelFeedMessageEvent to the one event actually posted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merging to
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 |
|
| const backendChannelId = await resolveBackendChannelId( | ||
| client, | ||
| channelName, | ||
| ).catch(() => undefined); | ||
|
|
||
| const result = await taskService.createTask( | ||
| { | ||
| content: buildContextGenerationPrompt({ channelName, channelId }), | ||
| taskDescription: `Generate CONTEXT.md for #${channelName}`, | ||
| // Defaults to a cloud run — generation should never tie up (or | ||
| // depend on) the local machine, and it's never the sticky last-used | ||
| // workspace mode. The dev-only picker can override to "local" to | ||
| // test a local build of these features before merging. | ||
| content: buildContextGenerationPrompt({ | ||
| channelName, | ||
| channelId, | ||
| description, | ||
| }), | ||
| taskDescription: `Build CONTEXT.md for ${channelName}`, | ||
| workspaceMode, | ||
| adapter: adapter ?? "claude", | ||
| model, | ||
| channelId: backendChannelId, |
There was a problem hiding this comment.
When backend channel resolution fails, this path swallows the error and still creates the planning task with channelId: undefined. The task can be created and filed to Recents, but it will not be owned by the feed channel and the feed-message block is skipped, so the user lands on a new context with no task card or “building CONTEXT.md” row even though the session started.
| const buildingAt = new Date( | ||
| new Date(task.created_at).getTime() - 1, | ||
| ).toISOString(); |
There was a problem hiding this comment.
If the task creation response has a missing or invalid created_at, this success path throws from toISOString() after the task has already been created and filed. That rejects generate() instead of just skipping the optional feed timestamp, leaving the create flow in a failed state even though the planning task exists.
|
|
||
| track(ANALYTICS_EVENTS.CONTEXT_ACTION, { | ||
| action_type: "generate_started", | ||
| channel_id: contextId, | ||
| }); | ||
| const task = await generate({ |
There was a problem hiding this comment.
generate() can reject outside its null return path, but this submit handler awaits it without a try/catch after the context may already have been created. A network/model/task creation error then bypasses the recovery that stashes the description and navigates to the new context, leaving the modal flow in an unhandled failed state.
Rule Used: Always wrap asynchronous calls that may fail, such... (source)
Learned From
PostHog/posthog#32098
| hasError, | ||
| errorTitle, | ||
| } = useSessionViewState(taskId, task); | ||
| useSessionConnection({ taskId, task, session, repoPath, isCloud }); |
There was a problem hiding this comment.
Opening the thread dock now mounts useSessionConnection for any task. For a local task with no existing run, that connection path can start a fresh agent run from the task description, so clicking a task card just to read or reply in the thread can start agent work and consume resources without an explicit run action.
Reduce vertical padding on channel feed and demo message thread items, and trim the inline mention/link chip padding for a denser feed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Built on PR: #3370 ( which is mergable )
but we're going to hack on this branch for demo.
Needs posthog/posthog local on branch: PostHog/posthog#70320