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

fix: handle chat app not found#19947

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

Merged
BrunoQuaresma merged 11 commits intomainfrombq/fix-show-error-when-chat-unhelathy
Sep 26, 2025
Merged
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

Some comments aren't visible on the classic Files Changed page.

23 changes: 8 additions & 15 deletionssite/src/modules/tasks/tasks.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,19 +16,12 @@ export type WorkspaceAppWithAgent = WorkspaceApp & {
};

export function getTaskApps(task: Task): WorkspaceAppWithAgent[] {
return (
task.workspace.latest_build.resources
.flatMap((r) => r.agents ?? [])
.flatMap((agent) =>
agent.apps.map((app) => ({
...app,
agent,
})),
)
// The Chat UI app will be displayed in the sidebar, so we don't want to
// show it as a tab.
.filter(
(app) => app.id !== task.workspace.latest_build.ai_task_sidebar_app_id,
)
);
return task.workspace.latest_build.resources
.flatMap((r) => r.agents ?? [])
.flatMap((agent) =>
agent.apps.map((app) => ({
...app,
agent,
})),
);
}
39 changes: 36 additions & 3 deletionssite/src/pages/TaskPage/TaskAppIframe.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,9 +84,7 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
</div>
)}

{app.health === "healthy" ||
app.health === "disabled" ||
app.health === "unhealthy" ? (
{app.health === "healthy" || app.health === "disabled" ? (
<iframe
ref={frameRef}
src={link.href}
Expand All@@ -95,6 +93,41 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
className={"w-full h-full border-0"}
allow="clipboard-read; clipboard-write"
/>
) : app.health === "unhealthy" ? (
<div className="w-full h-full flex flex-col items-center justify-center p-4">
<h3 className="m-0 font-medium text-content-primary text-base text-center">
App "{app.display_name}" is unhealthy
</h3>
<div className="text-content-secondary text-sm">
<span className="block text-center">
Here are some troubleshooting steps you can take:
</span>
<ul className="m-0 pt-4 flex flex-col gap-4">
{app.healthcheck && (
<li>
<span className="block font-medium text-content-primary mb-1">
Verify healthcheck
</span>
Try running the following inside your workspace:{" "}
<code className="font-mono text-content-primary select-all">
curl -v "{app.healthcheck.url}"
</code>
</li>
)}
<li>
<span className="block font-medium text-content-primary mb-1">
Check logs
</span>
See{" "}
<code className="font-mono text-content-primary select-all">
/tmp/coder-agent.log
</code>{" "}
inside your workspace "{task.workspace.name}" for more
information.
</li>
</ul>
</div>
</div>
) : app.health === "initializing" ? (
<div className="w-full h-full flex items-center justify-center">
<Spinner loading />
Expand Down
2 changes: 2 additions & 0 deletionssite/src/pages/TaskPage/TaskApps.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ import { TaskApps } from "./TaskApps";
const mockExternalApp: WorkspaceApp = {
...MockWorkspaceApp,
external: true,
health: "healthy",
};

const meta: Meta<typeof TaskApps> = {
Expand DownExpand Up@@ -103,6 +104,7 @@ function mockEmbeddedApp(name = MockWorkspaceApp.display_name): WorkspaceApp {
slug: kebabCase(name),
display_name: name,
external: false,
health: "healthy",
};
}

Expand Down
58 changes: 34 additions & 24 deletionssite/src/pages/TaskPage/TaskApps.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,35 +28,45 @@ type TaskAppsProps = {
};

export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
const apps = getTaskApps(task);
const apps = getTaskApps(task).filter(
// The Chat UI app will be displayed in the sidebar, so we don't want to
// show it as a web app.
(app) =>
app.id !== task.workspace.latest_build.ai_task_sidebar_app_id &&
app.health !== "disabled",
);
const [embeddedApps, externalApps] = splitEmbeddedAndExternalApps(apps);
const [activeAppId, setActiveAppId] = useState(embeddedApps.at(0)?.id);
const hasAvailableAppsToDisplay =
embeddedApps.length > 0 || externalApps.length > 0;

return (
<main className="flex flex-col h-full">
<div className="w-full flex items-center border-0 border-b border-border border-solid">
<ScrollArea className="max-w-full">
<div className="flex w-max gap-2 items-center p-2 pb-0">
{embeddedApps.map((app) => (
<TaskAppTab
key={app.id}
task={task}
app={app}
active={app.id === activeAppId}
onClick={(e) => {
e.preventDefault();
setActiveAppId(app.id);
}}
/>
))}
</div>
<ScrollBar orientation="horizontal" className="h-2" />
</ScrollArea>

{externalApps.length > 0 && (
<ExternalAppsDropdown task={task} externalApps={externalApps} />
)}
</div>
{hasAvailableAppsToDisplay && (
<div className="w-full flex items-center border-0 border-b border-border border-solid">
<ScrollArea className="max-w-full">
<div className="flex w-max gap-2 items-center p-2 pb-0">
{embeddedApps.map((app) => (
<TaskAppTab
key={app.id}
task={task}
app={app}
active={app.id === activeAppId}
onClick={(e) => {
e.preventDefault();
setActiveAppId(app.id);
}}
/>
))}
</div>
<ScrollBar orientation="horizontal" className="h-2" />
</ScrollArea>

{externalApps.length > 0 && (
<ExternalAppsDropdown task={task} externalApps={externalApps} />
)}
</div>
)}

{embeddedApps.length > 0 ? (
<div className="flex-1">
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp