Skip to content

fix(site): only attempt to watch when dev containers enabled #18892

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: slightly
  • Loading branch information
DanielleMaywood committed Jul 15, 2025
commit c2f43efcc35c38a1c6176e6def54d5bf42a0ce3f
18 changes: 6 additions & 12 deletions site/src/modules/resources/useAgentContainers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,13 @@ export function useAgentContainers(

useEffect(() => {
const devcontainerFeatureDisabled =
queryError instanceof AxiosError &&
queryError.status === 403 &&
queryError.response?.data.message ===
"Dev Container feature not enabled.";

// We do not want to attempt to call the `/watch` endpoint
// if the agent isn't connected yet as the endpoint will
// not be ready to call.
if (
agent.status !== "connected" ||
queryIsLoading ||
devcontainerFeatureDisabled
) {
(queryError instanceof AxiosError &&
queryError.status === 403 &&
queryError.response?.data.message ===
"Dev Container feature not enabled.");

if (agent.status !== "connected" || devcontainerFeatureDisabled) {
return;
}

Expand Down
Loading