Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the VS Code Agent View can show when a thread or agent lane is on another
branch. Agent View and restore-point data now auto-refresh on a configurable
read-only interval so branch/workspace changes become visible without a
manual refresh. This answers the VS Code GUI lane without exposing chat
webviews, inline edits, or retry/undo/restore runtime mutation endpoints yet
manual refresh. Agent View refreshes keep thread branch/workspace rows
independent from restore-point loading, so a snapshot-listing failure no
longer clears already-available thread metadata. This answers the VS Code GUI
lane without exposing chat webviews, inline edits, or retry/undo/restore
runtime mutation endpoints yet
(#461, #462, #480, #1217, #2341, #1584, #2327, #2580, #2808). Thanks @AiurArtanis
for the Agent View prompt, @lbcheng888 for the earlier scaffold, @gaord for
the GUI runtime API direction, @douglarek, @caeserchen, and @nightt5879 for
Expand Down
7 changes: 5 additions & 2 deletions crates/tui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the VS Code Agent View can show when a thread or agent lane is on another
branch. Agent View and restore-point data now auto-refresh on a configurable
read-only interval so branch/workspace changes become visible without a
manual refresh. This answers the VS Code GUI lane without exposing chat
webviews, inline edits, or retry/undo/restore runtime mutation endpoints yet
manual refresh. Agent View refreshes keep thread branch/workspace rows
independent from restore-point loading, so a snapshot-listing failure no
longer clears already-available thread metadata. This answers the VS Code GUI
lane without exposing chat webviews, inline edits, or retry/undo/restore
runtime mutation endpoints yet
(#461, #462, #480, #1217, #2341, #1584, #2327, #2580, #2808). Thanks @AiurArtanis
for the Agent View prompt, @lbcheng888 for the earlier scaffold, @gaord for
the GUI runtime API direction, @douglarek, @caeserchen, and @nightt5879 for
Expand Down
47 changes: 26 additions & 21 deletions extensions/vscode/out/extension.js

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

2 changes: 1 addition & 1 deletion extensions/vscode/out/extension.js.map

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

45 changes: 26 additions & 19 deletions extensions/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@ export function activate(context: vscode.ExtensionContext): void {
output.appendLine(`Loaded ${snapshots.length} runtime restore points.`);
};

const refreshAgentViewDetails = async (showWarning: boolean): Promise<void> => {
try {
await refreshAgentView();
} catch (error: unknown) {
const detail = error instanceof Error ? error.message : String(error);
statusView.updateThreads([], "Runtime thread summaries unavailable.");
output.appendLine(`Runtime thread summaries unavailable: ${detail}`);
if (showWarning) {
void vscode.window.showWarningMessage(detail);
}
}

try {
await refreshSnapshots();
} catch (error: unknown) {
const detail = error instanceof Error ? error.message : String(error);
statusView.updateSnapshots([], detail);
output.appendLine(`Runtime restore points unavailable: ${detail}`);
if (showWarning) {
void vscode.window.showWarningMessage(detail);
}
}
};
Comment on lines +41 to +63
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The functions refreshAgentView() and refreshSnapshots() are executed sequentially with await. Since these operations are independent, running them sequentially introduces unnecessary latency, especially if one of the network requests is slow or times out. Running them concurrently using Promise.all would improve the responsiveness of the Agent View.

  const refreshAgentViewDetails = async (showWarning: boolean): Promise<void> => {
    const agentViewPromise = refreshAgentView().catch((error: unknown) => {
      const detail = error instanceof Error ? error.message : String(error);
      statusView.updateThreads([], "Runtime thread summaries unavailable.");
      output.appendLine(`Runtime thread summaries unavailable: ${detail}`);
      if (showWarning) {
        void vscode.window.showWarningMessage(detail);
      }
    });

    const snapshotsPromise = refreshSnapshots().catch((error: unknown) => {
      const detail = error instanceof Error ? error.message : String(error);
      statusView.updateSnapshots([], detail);
      output.appendLine(`Runtime restore points unavailable: ${detail}`);
      if (showWarning) {
        void vscode.window.showWarningMessage(detail);
      }
    });

    await Promise.all([agentViewPromise, snapshotsPromise]);
  };


const updateStatus = (text: string, tooltip: string): void => {
status.text = text;
status.tooltip = tooltip;
Expand All @@ -59,15 +83,7 @@ export function activate(context: vscode.ExtensionContext): void {
switch (state.kind) {
case "connected":
updateStatus("$(check) CodeWhale", state.detail);
try {
await refreshAgentView();
await refreshSnapshots();
} catch (error: unknown) {
const detail = error instanceof Error ? error.message : String(error);
statusView.updateThreads([], "Runtime thread summaries unavailable.");
statusView.updateSnapshots([], detail);
output.appendLine(`Runtime Agent View details unavailable: ${detail}`);
}
await refreshAgentViewDetails(false);
break;
case "auth-required":
updateStatus("$(lock) CodeWhale", state.detail);
Expand Down Expand Up @@ -161,16 +177,7 @@ export function activate(context: vscode.ExtensionContext): void {

context.subscriptions.push(
vscode.commands.registerCommand("codewhale.refreshAgentView", async () => {
try {
await refreshAgentView();
await refreshSnapshots();
} catch (error: unknown) {
const detail = error instanceof Error ? error.message : String(error);
statusView.updateThreads([], "Runtime thread summaries unavailable.");
statusView.updateSnapshots([], detail);
output.appendLine(`Runtime Agent View details unavailable: ${detail}`);
void vscode.window.showWarningMessage(detail);
}
await refreshAgentViewDetails(true);
}),
);

Expand Down
Loading