Glassworm style attacks added to repo policy check#2038
Open
Glassworm style attacks added to repo policy check#2038
Conversation
…urce and not in the unpacked from the asar.
This reverts commit 38f9bf6.
CI `build_ts (windows-latest, 20)` was failing due to prettier formatting violations in the `agent-shell` package. ## Changes - **`src/main/instance.ts`** — reformat `getIndexingServiceRegistry` call to multi-line style - **`src/main/inlineBrowserControl.ts`** — fix indentation in ternary string concatenation <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Fix the failing GitHub Actions workflow build_ts (windows-latest, 20) > Analyze the workflow logs, identify the root cause of the failure, and implement a fix. > Job ID: 68117616157 > Job URL: https://github.com/microsoft/TypeAgent/actions/runs/23418154365/job/68117616157 </details> <!-- START COPILOT CODING AGENT TIPS --> --- 📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs), [Azure Boards](https://gh.io/cca-azure-boards-docs) or [Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in one click without leaving your project management tool. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: robgruen <25374553+robgruen@users.noreply.github.com>
…l.ts (#2053) `build_ts` CI was failing on the Lint step across all matrix configurations (ubuntu/windows, Node 20/22) due to a Prettier formatting violation in `ts/packages/shell/src/main/inlineBrowserControl.ts` — specifically, incorrect indentation in ternary string concatenation expressions. ## Changes - **`ts/packages/shell/src/main/inlineBrowserControl.ts`** — reformatted to comply with Prettier rules; `prettier --check . --ignore-path ../../.prettierignore` now passes for the `agent-shell` package <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Fix the failing GitHub Actions workflow build_ts (ubuntu-latest, 22) > Analyze the workflow logs, identify the root cause of the failure, and implement a fix. > Job ID: 68258600244 > Job URL: https://github.com/microsoft/TypeAgent/actions/runs/23459866482/job/68258600244 </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…d dispatcher-ready signal (#2057) `startShell()` returned as soon as `contenteditable="true"` was set, before `dispatcherInitialized()` finished its async work (display-log replay + replay-queue drain). With `agentGreeting` disabled by default the old greeting-wait safety net is gone, exposing two races. ## Race 1 — command backstack pollution (`@exit` instead of `@history`) `dispatcherInitialized` replays the persistent `DisplayLog` (loaded from disk across restarts) via direct `chatView.addRemoteUserMessage()` calls that bypass `withReplayQueue`. These nodes land in the DOM **without** `.history`, so `@exit` from the previous session's `exitApplication()` leaks into the backstack query. ## Race 2 — metrics never written → `create_update_clear_list` timeout While `replayPending = true` all client-IO IPC callbacks are queued. When a test request is sent during this window, `requestCompleted()` fires (the dispatcher Promise resolves) before the queued response is promoted to the DOM. `MessageGroup.agentMessages` is empty at that point, so `updateMetrics()` writes nothing and `isMessageCompleted()` never finds `.metrics-details[Total]`, timing out after 90 s. ## Changes - **`main.ts` (`dispatcherInitialized`)** — after the replay loop, mark all scroll-container children `.history` (covers both HTML-snapshot entries and just-replayed display-log entries), then clear `replayPending` / drain the replay queue, then set `data-dispatcher-ready="true"` on the scroll container. The signal is placed *after* `replayPending = false` so new IPC is processed inline by the time tests start. ```ts // mark replay entries as historical for (const child of Array.from(chatView.getScrollContainer().children)) { (child as HTMLElement).classList.add("history"); } replayPending = false; for (const fn of replayQueue) fn(); replayQueue.length = 0; chatView.getScrollContainer().setAttribute("data-dispatcher-ready", "true"); ``` - **`testHelper.ts` (`startShell`)** — after the `contenteditable` check, wait for `.chat[data-dispatcher-ready='true']` before returning, ensuring `replayPending` is already `false` when the first test request is sent. - **`chatView.ts` (backstack selector)** — reverts the selector introduced in #2046 back to checking `.history` on the element itself (`.chat-message-container-user:not(.history)…`), which is correct now that both `initializeChatHistory` and the new replay-marking loop stamp `.history` directly on `.chat-message-container-user` nodes. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: robgruen <25374553+robgruen@users.noreply.github.com>
The `build_ts` CI job was failing because `test/testHelper.ts` in
`agent-shell` failed the prettier formatting check — a newly added
`waitFor` call exceeded the line length limit.
## Change
Reformatted the object argument in `scrollContainer.waitFor()` to
multi-line style:
```ts
// Before
await scrollContainer.waitFor({ timeout: 120000, state: "attached" });
// After
await scrollContainer.waitFor({
timeout: 120000,
state: "attached",
});
```
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> Fix the failing GitHub Actions workflow build_ts (macos-latest, 22)
> Analyze the workflow logs, identify the root cause of the failure, and
implement a fix.
> Job ID: 68274110387
> Job URL:
https://github.com/microsoft/TypeAgent/actions/runs/23464662092/job/68274110387
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
⌨️ Start Copilot coding agent tasks without leaving your editor —
available in [VS Code](https://gh.io/cca-vs-code-docs), [Visual
Studio](https://gh.io/cca-visual-studio-docs), [JetBrains
IDEs](https://gh.io/cca-jetbrains-docs) and
[Eclipse](https://gh.io/cca-eclipse-docs).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: robgruen <25374553+robgruen@users.noreply.github.com>
The `create_update_clear_list` Playwright test was timing out because
the dispatcher's command pipeline was never warmed up before test
commands arrived. The root cause: `agentGreeting` was changed to `false`
in the default shell settings, which silently removed the `@greeting
--mock` startup command that previously ran `processShellRequest` once
before any test request, initialising the `commandLock`,
`updateSummary`, and agent infrastructure.
Without that warm-up, the first NL request ("create a shopping list")
had to absorb all cold-start cost itself and consistently exceeded the
90-second `waitForAgentMessage` timeout.
## Change
- **`ts/packages/shell/src/preload/shellSettingsType.ts`** — restore
`agentGreeting` default to `true`
```ts
// Before
agentGreeting: false,
// After
agentGreeting: true,
```
With the greeting re-enabled, `@greeting --mock` (injected because tests
always pass `--mock-greetings`) runs through `processShellRequest` at
startup. The dispatcher is warm by the time test commands arrive, and NL
requests complete well within the timeout.
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> Fix the failing GitHub Actions workflow shell_and_cli (windows-latest,
22)
> Analyze the workflow logs, identify the root cause of the failure, and
implement a fix.
> Job ID: 68284995089
> Job URL:
https://github.com/microsoft/TypeAgent/actions/runs/23468206726/job/68284995089
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
🔒 GitHub Advanced Security automatically protects Copilot coding agent
pull requests. You can protect all pull requests by enabling Advanced
Security for your repositories. [Learn more about Advanced
Security.](https://gh.io/cca-advanced-security)
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: robgruen <25374553+robgruen@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.