Skip to content

Comments

Feat: Sandbox Logs#239

Open
ben-fornefeld wants to merge 26 commits intomainfrom
implement-sandbox-details-logs
Open

Feat: Sandbox Logs#239
ben-fornefeld wants to merge 26 commits intomainfrom
implement-sandbox-details-logs

Conversation

@ben-fornefeld
Copy link
Member

@ben-fornefeld ben-fornefeld commented Feb 11, 2026

Note

Medium Risk
Touches log retrieval/pagination and polling behavior across both sandbox and build log viewers, which can impact correctness (duplicates/missing logs) and UI performance, but does not alter auth or data mutation paths.

Overview
Adds a new sandbox logs experience: introduces GET /v2/sandboxes/{sandboxID}/logs in the infra OpenAPI, wires it through a new sandbox tRPC router + repository, and ships a new /dashboard/.../sandboxes/{id}/logs page with a virtualized, live-polling log viewer (pagination, retention messaging, and end/live status rows).

Refactors build log fetching to be cursor-based without key-based deduping (tracking “seen at cursor” for forward/backward loads) and improves polling drain behavior after builds stop. Updates sandbox navigation to default to Logs (new tabbed Logs/Filesystem layout, new StorageIcon), moves refresh/kill controls into the tabs header accessory, and adds breadcrumb-style titles with copy-to-clipboard support for sandbox/build identifiers.

Written by Cursor Bugbot for commit 470f89e. This will update automatically on new commits. Configure here.

- Removed redundant wrapper in SandboxDetailsHeader for SandboxDetailsTitle.
- Updated DashboardLayoutHeader to ensure consistent rendering of ThemeSwitcher.
- Refactored logs handling in VirtualizedLogsBody to utilize state for scroll container, enhancing performance and readability.
- Adjusted event listeners for scroll handling to improve responsiveness.
@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Feb 19, 2026 11:55pm
web-juliett Ready Ready Preview, Comment Feb 19, 2026 11:55pm

Request Review

{ cursor, limit, direction }
)

const logs: SandboxLogDTO[] = sandboxLogs.logs
Copy link
Member

Choose a reason for hiding this comment

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

is this needed?


const logs: SandboxLogDTO[] = sandboxLogs.logs
.map(mapInfraSandboxLogToDTO)
.sort((a, b) => a.timestampUnix - b.timestampUnix)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.sort((a, b) => a.timestampUnix - b.timestampUnix)

export const sandboxRouter = createTRPCRouter({
// QUERIES

logsBackwards: protectedTeamProcedure
Copy link
Member

Choose a reason for hiding this comment

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

you should reverse outside this query

Copy link
Member

Choose a reason for hiding this comment

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

or add at least comment

}

return logs.slice(0, end)
}
Copy link

Choose a reason for hiding this comment

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

Cursor-tracking helpers duplicated across two store files

Low Severity

countLeadingAtTimestamp, countTrailingAtTimestamp, dropLeadingAtTimestamp, and dropTrailingAtTimestamp are copy-pasted identically between sandbox-logs-store.ts and build-logs-store.ts. Both only access the timestampUnix property, so a single generic or shared implementation would work for both DTO types.

Additional Locations (1)

Fix in Cursor Fix in Web

<LogsTableHeader
timestampWidth={COLUMN_WIDTHS_PX.timestamp}
levelWidth={COLUMN_WIDTHS_PX.level}
/>
Copy link

Choose a reason for hiding this comment

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

Sandbox logs header shows wrong sort direction arrow

Low Severity

The LogsTableHeader in both SandboxLogs and LogsContent omits timestampSortDirection, which defaults to 'desc' (down arrow). However, sandbox logs are displayed in ascending chronological order (oldest at top, newest at bottom), just like build logs. Build logs correctly pass timestampSortDirection="asc" — the sandbox logs views need the same to show the correct up-arrow indicator.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

# AI agents and related files
CLAUDE.md
.agent
.cursor/
Copy link

Choose a reason for hiding this comment

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

Gitignore removes IDE and tooling ignore patterns

Low Severity

This commit removes .vscode/, .idea/, .cursor/, .claude/, .agents/, .codex/, .copilot/, .github/copilot/, .anthropic/, and .openai/ from .gitignore. These are standard IDE and AI-tool configuration directories. This change appears unrelated to the Sandbox Logs feature and could lead to tool configuration files being accidentally committed.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants