Repository navigation
Fix sessions hidden by reused preview deployments - #856
Conversation
| } | ||
| const environmentSessions = project | ||
| ? sessionsForEnvironment( | ||
| ? sessionsForDeploymentAlias( |
There was a problem hiding this comment.
🔴 Default playground sessions disappear after preview reuse
When a default playground session uses a reused preview deployment, environmentSessions excludes it because the deployment retains its preview alias. The session disappears from playground history despite recording default as its environment.
Learn more
Playground history uses the agent's newest session summaries. A deployment can retain its original pr-3 alias after becoming active in the default environment. The alias-only filter excludes sessions created through the default playground on that deployment, even though their summaries record environment: 'default'. The project Sessions tab does not offer an alternate way to find them because it explicitly excludes playground sessions at externalSessions.
Example: Deployment preview-3 has alias pr-3 and becomes active in default. A playground session on default records environment: 'default' and deploymentId: 'preview-3'. The default playground requests alias default, so the filter drops that session instead of displaying it.
Recommended fix: For non-preview playground targets, filter recorded session environments as sessionsForEnvironment does, retaining the legacy fallback for null environments. Keep preview targeting separate; a deployment's immutable alias alone cannot distinguish preview history when the same deployment is reused across targets.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Fixed in 8de575a. Normal/default playground history now filters by the recorded session environment; deployment-alias filtering is used only when an explicit PR preview alias is selected. Focused tests, typecheck, and formatting pass.
Problem
The project Sessions page inferred a session's environment from its deployment's creation alias. When a main build reused an identical preview artifact, the active
defaultdeployment retained its originalpr-3provenance label, so validdefaultsessions disappeared from the list.Fix
pr-<n>is a deployment target rather than an environment.Verification
npm test -- --run src/managed-agents/session-history.test.ts— 11 passingnpm run typecheck— passingdefaultsession backed by a deployment labelledpr-3.