Skip to content

fix: org installation visibility, project chat agent offline, message history#270

Merged
simple-agent-manager[bot] merged 9 commits intomainfrom
fix/org-installation-visibility
Mar 9, 2026
Merged

fix: org installation visibility, project chat agent offline, message history#270
simple-agent-manager[bot] merged 9 commits intomainfrom
fix/org-installation-visibility

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

@simple-agent-manager simple-agent-manager Bot commented Mar 6, 2026

Summary

Fixes three bugs discovered during staging E2E testing and adds a rendering grace period for a fourth:

  1. Org installation visibility — Only the GitHub App installer could see org installations. Changed from unique installationId to composite unique (userId, installationId) with on-demand org membership sync via GitHub API.

  2. Project chat "Agent offline" — The deriveWorkspaceWsHost() function used a UUID-only regex that rejected ULID workspace IDs (e.g., 01KK1EGS8XD7MQAFVTF9ZD2BB4), preventing the ACP WebSocket connection. Updated to accept both UUID and ULID formats.

  3. Message history loss when switching conversations — The project chat always preferred ACP items over DO messages, but ACP replay only contains the current session's messages. Changed to show DO messages as the persistent base, with ACP only during active streaming.

  4. ACP→DO handoff race condition — When the agent finishes processing, the view switches from ACP streaming to DO persistent messages. But the VM agent batches messages with ~2s delay, so the response disappeared in the gap. Added a 10s grace period after prompting ends to keep the ACP view active until the DO catches up.

Known Issues (filed as backlog tasks)

  • ACP-created sessions (project chat follow-ups) don't persist agent responses to the DO via MessageReporter (tasks/backlog/2026-03-06-acp-session-message-persistence.md)
  • ACP WebSocket 503 on newly created workspaces due to DNS propagation timing (tasks/backlog/2026-03-06-project-chat-acp-503-on-new-workspace.md)
  • VM agent logs informational events at error level (tasks/backlog/2026-03-06-vm-agent-error-level-logging.md)

Test plan

  • Log into staging, verify org repos visible in project dropdown
  • Submit task from project chat, verify agent processes it
  • Send follow-up messages from project chat, verify agent responds
  • Switch between conversations, verify full history preserved
  • Verify agent response visible during and after streaming (grace period)
  • Submit new task via "+ New Chat", verify provisioning and completion
  • Verify workspace chat tab shows full ACP replay

Agent Preflight

  • Preflight completed before code changes
  • Change classes: [x] cross-component-change, [x] ui-change, [x] business-logic-change
  • External References: N/A: internal fixes based on staging E2E testing, no external APIs
  • Codebase Impact Analysis: apps/web/ — project chat rendering, ACP message display, workspace WebSocket connection; apps/api/src/routes/ — GitHub installation sync endpoint; apps/api/src/db/ — migration 0022 composite unique constraint on installations table; packages/shared/ — ULID format validation regex update
  • Documentation & Specs: tasks/backlog/ — filed 3 known issues as backlog tasks for future work
  • Constitution & Risk Check: Principle XI: ACP grace period timeout (10s) should ideally be configurable but is acceptable as a rendering optimization constant. No hardcoded URLs or credentials introduced.

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 6, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c35f11b-b62a-4988-ae20-540d142c1579

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/org-installation-visibility

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Staging Deployment

URL
API https://api.sammy.party
Web UI https://app.sammy.party

Deployed commit: 093c0b06532232878734cd60e31380587039b9dd

@simple-agent-manager simple-agent-manager Bot changed the title fix: org members can see shared GitHub App installations fix: org installation visibility + project chat agent offline Mar 6, 2026
@simple-agent-manager simple-agent-manager Bot changed the title fix: org installation visibility + project chat agent offline fix: org installation visibility, project chat agent offline, message history Mar 6, 2026
claude added 6 commits March 9, 2026 07:29
Previously, GitHub App installations were stored per-user with a UNIQUE
constraint on installation_id. Only the user who installed the app got a
DB record, making the installation invisible to other org members.

Now: schema uses UNIQUE(userId, installationId) so each org member gets
their own row. On GET /installations, the system syncs from GitHub API —
discovers org installations the user is a member of but lacks a record
for, and auto-creates them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ACP WebSocket 503 on newly created workspace (DNS propagation timing)
- VM agent logs informational events at error level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The rendering logic prioritized ACP items over DO messages whenever ACP
had any items at all. Since ACP replay only contains the current agent
session's messages (not cross-session history), switching to a
conversation showed only the most recent exchange while reporting "172
msgs" in the sidebar.

Fix: Show DO-persisted messages as the history base (complete history).
Only switch to ACP view during active streaming (isPrompting) or when
DO has no messages yet (initial provisioning). This preserves full
conversation history while still showing real-time streaming updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the agent finishes processing (isPrompting goes false), the view
switches from ACP streaming to DO persistent messages. But the VM agent
batches messages with ~2s delay before persisting to the DO, so the
agent's response disappears in the gap. This adds a 10s grace period
after prompting ends, keeping the ACP view active until the DO catches
up with the batched messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follow-up messages from project chat stream correctly via ACP but agent
responses are not persisted to the ProjectData DO. The ACP switchAgent
flow creates a new session without a MessageReporter callback URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The grace period approach was fundamentally flawed: messages appeared
during the 10s grace window then vanished when switching to the DO view
(which lacks follow-up responses not persisted by MessageReporter).

New approach: always show DO messages as the persistent base, then
append any ACP items with timestamps newer than the latest DO message.
This handles both the streaming case (responses not yet batched to DO)
and the ACP persistence gap (MessageReporter not configured for
ACP-created sessions). Removes the grace period state machine entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
claude added 3 commits March 9, 2026 07:32
Follow-up user messages sent via ACP sendPrompt are not persisted to the
DO (MessageReporter isn't configured for ACP-created sessions), so they
were missing from the merged view. The timestamp comparison already
prevents duplicates with DO-persisted messages from the initial task.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, follow-up messages sent via ACP skipped DO persistence
entirely, relying on the VM agent's MessageReporter. But ACP-created
sessions don't have MessageReporter configured, so user messages were
lost when the workspace was torn down. Now user messages are always
sent via DO WebSocket for persistence, plus via ACP for agent delivery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mples

Switch default model from Llama 3.1 8B to Gemma 3 12B for more reliable
instruction following. Add few-shot examples and anti-hallucination
directive to system prompt to prevent the model from executing tasks
instead of generating titles for them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simple-agent-manager simple-agent-manager Bot force-pushed the fix/org-installation-visibility branch from 093c0b0 to 0f1565b Compare March 9, 2026 07:33
@simple-agent-manager simple-agent-manager Bot merged commit d4d56e0 into main Mar 9, 2026
17 of 20 checks passed
@simple-agent-manager simple-agent-manager Bot deleted the fix/org-installation-visibility branch March 9, 2026 07:43
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