Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): surface devcontainer start error#18637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
DanielleMaywood wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromdanielle/surface-devcontainer-errors
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionsagent/agentcontainers/api.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -685,6 +685,8 @@ func (api *API) processUpdatedContainersLocked(ctx context.Context, updated code
iferr!=nil {
logger.Error(ctx,"inject subagent into container failed",slog.Error(err))
}

dc.Error=err.Error()
Copy link
Member

Choose a reason for hiding this comment

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

We might want to reset this in some other scenarios as well, like recreate. And assign on recreate error. There’s also the devcontainer status but I don’t think we need to touch it necessarily in this case since it’s an injection error but the devcontainer itself is probably fine.

}

casedc.Container==nil:
Expand Down
3 changes: 3 additions & 0 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 3 additions & 0 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 2 additions & 0 deletionscodersdk/workspaceagents.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -417,6 +417,8 @@ type WorkspaceAgentDevcontainer struct {
Dirtybool`json:"dirty"`
Container*WorkspaceAgentContainer`json:"container,omitempty"`
Agent*WorkspaceAgentDevcontainerAgent`json:"agent,omitempty"`

Errorstring`json:"error,omitempty"`
}

// WorkspaceAgentDevcontainerAgent represents the sub agent for a
Expand Down
1 change: 1 addition & 0 deletionsdocs/reference/api/agents.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 3 additions & 0 deletionsdocs/reference/api/schemas.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

1 change: 1 addition & 0 deletionssite/src/api/typesGenerated.ts
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

21 changes: 18 additions & 3 deletionssite/src/modules/resources/AgentDevcontainerCard.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ import type {
WorkspaceAgentDevcontainer,
WorkspaceAgentListContainersResponse,
} from "api/typesGenerated";

import { Button } from "components/Button/Button";
import { displayError } from "components/GlobalSnackbar/utils";
import { Spinner } from "components/Spinner/Spinner";
Expand All@@ -27,12 +28,13 @@ import { portForwardURL } from "utils/portForward";
import { AgentApps, organizeAgentApps } from "./AgentApps/AgentApps";
import { AgentButton } from "./AgentButton";
import { AgentLatency } from "./AgentLatency";
import {SubAgentStatus } from "./AgentStatus";
import {DevcontainerStatus } from "./AgentStatus";
import { PortForwardButton } from "./PortForwardButton";
import { AgentSSHButton } from "./SSHButton/SSHButton";
import { SubAgentOutdatedTooltip } from "./SubAgentOutdatedTooltip";
import { TerminalLink } from "./TerminalLink/TerminalLink";
import { VSCodeDevContainerButton } from "./VSCodeDevContainerButton/VSCodeDevContainerButton";
import { cn } from "utils/cn";

type AgentDevcontainerCardProps = {
parentAgent: WorkspaceAgent;
Expand DownExpand Up@@ -190,7 +192,10 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
key={devcontainer.id}
direction="column"
spacing={0}
className="relative py-4 border border-dashed border-border rounded"
className={cn(
"relative py-4 border border-dashed border-border rounded",
devcontainer.error && "border-content-destructive border-solid",
)}
>
<div
className="absolute -top-2 left-5
Expand All@@ -208,7 +213,11 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
>
<div className="flex items-center gap-6 text-xs text-content-secondary">
<div className="flex items-center gap-4 md:w-full">
<SubAgentStatus agent={subAgent} />
<DevcontainerStatus
devcontainer={devcontainer}
parentAgent={parentAgent}
agent={subAgent}
/>
<span
className="max-w-xs shrink-0
overflow-hidden text-ellipsis whitespace-nowrap
Expand DownExpand Up@@ -273,6 +282,12 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
</div>
</header>

{devcontainer.error && (
<div className="px-8 pt-2 text-xs text-content-destructive">
{devcontainer.error}
</div>
)}

{(showSubAgentApps || showSubAgentAppsPlaceholders) && (
<div className="flex flex-col gap-8 px-8 pt-4">
{subAgent &&
Expand Down
8 changes: 8 additions & 0 deletionssite/src/modules/resources/AgentRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -156,6 +156,9 @@ export const AgentRow: FC<AgentRowProps> = ({
shouldDisplayAppsSection = false;
}

// Check if any devcontainers have errors to gray out agent border
const hasDevcontainerErrors = devcontainers?.some((dc) => dc.error);

return (
<Stack
key={agent.id}
Expand All@@ -165,6 +168,7 @@ export const AgentRow: FC<AgentRowProps> = ({
styles.agentRow,
styles[`agentRow-${agent.status}`],
styles[`agentRow-lifecycle-${agent.lifecycle_state}`],
hasDevcontainerErrors && styles.agentRowWithErrors,
]}
>
<header css={styles.header}>
Expand DownExpand Up@@ -537,4 +541,8 @@ const styles = {
position: "relative",
},
}),

agentRowWithErrors: (theme) => ({
borderColor: theme.palette.divider,
}),
} satisfies Record<string, Interpolation<Theme>>;
49 changes: 48 additions & 1 deletionsite/src/modules/resources/AgentStatus.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
import type { Interpolation, Theme } from "@emotion/react";
import Link from "@mui/material/Link";
import Tooltip from "@mui/material/Tooltip";
import type { WorkspaceAgent } from "api/typesGenerated";
import type {
WorkspaceAgent,
WorkspaceAgentDevcontainer,
} from "api/typesGenerated";
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne";
import {
HelpTooltip,
Expand DownExpand Up@@ -50,6 +53,12 @@ interface SubAgentStatusProps {
agent?: WorkspaceAgent;
}

interface DevcontainerStatusProps {
devcontainer: WorkspaceAgentDevcontainer;
parentAgent: WorkspaceAgent;
agent?: WorkspaceAgent;
}

const StartTimeoutLifecycle: FC<AgentStatusProps> = ({ agent }) => {
return (
<HelpTooltip>
Expand DownExpand Up@@ -296,6 +305,44 @@ export const SubAgentStatus: FC<SubAgentStatusProps> = ({ agent }) => {
);
};

export const DevcontainerStartError: FC<AgentStatusProps> = ({ agent }) => {
return (
<HelpTooltip>
<PopoverTrigger role="status" aria-label="Start error">
<TriangleAlertIcon css={styles.errorWarning} />
</PopoverTrigger>
<HelpTooltipContent>
<HelpTooltipTitle>
Error starting the devcontainer agent
</HelpTooltipTitle>
<HelpTooltipText>
Something went wrong during the devcontainer agent startup.{" "}
<Link
target="_blank"
rel="noreferrer"
href={agent.troubleshooting_url}
>
Troubleshoot
</Link>
.
</HelpTooltipText>
</HelpTooltipContent>
</HelpTooltip>
);
};

export const DevcontainerStatus: FC<DevcontainerStatusProps> = ({
devcontainer,
parentAgent,
agent,
}) => {
if (devcontainer.error) {
return <DevcontainerStartError agent={parentAgent} />;
}

return <SubAgentStatus agent={agent} />;
};

const styles = {
status: {
width: 6,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp