Skip to content

Glassworm style attacks added to repo policy check#2038

Open
robgruen wants to merge 76 commits intomainfrom
dev/robgruen/glassworm
Open

Glassworm style attacks added to repo policy check#2038
robgruen wants to merge 76 commits intomainfrom
dev/robgruen/glassworm

Conversation

@robgruen
Copy link
Collaborator

No description provided.

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>
@robgruen robgruen temporarily deployed to development-fork March 24, 2026 07:29 — with GitHub Actions Inactive
@robgruen robgruen temporarily deployed to development-fork March 24, 2026 07:29 — with GitHub Actions Inactive
@robgruen robgruen marked this pull request as ready for review March 24, 2026 07:49
@robgruen robgruen added this pull request to the merge queue Mar 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants