Skip to content

[pull] main from microsoft:main#1319

Merged
pull[bot] merged 8 commits into
code:mainfrom
microsoft:main
Jun 1, 2026
Merged

[pull] main from microsoft:main#1319
pull[bot] merged 8 commits into
code:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jun 1, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

dileepyavan and others added 8 commits May 31, 2026 23:39
adding pdf support
…l refresh (#319216)

* sessions: recover empty Agent Host session list after a failed initial refresh

The Agents-app local session list could stay empty on launch and only
populate after the user started a new session. The provider's session
cache is one-shot: `_refreshSessions()` ran once, but its blanket catch
could not tell "listSessions() threw" (e.g. the agent throws
AHP_AUTH_REQUIRED before its token is effective server-side, or a
transient offline error) from "listSessions() returned []" (a genuinely
empty, valid result). Both collapsed to an empty cache marked
initialized, and nothing retried until an unrelated AHP event
(SessionTurnComplete / sessionAdded) forced a re- which is whyfetch
starting a new session "unstuck" the list.

`_refreshSessions` now owns `_cacheInitialized` and sets it only on a
successful list. On a thrown failure it logs and arms a capped
exponential-backoff retry (1s -> 30s, reset on success), so a transient
startup failure self-heals on its own. An empty successful list is still
treated as a valid result that marks the cache initialized and arms no
retry. Listing sessions still never pops a sign-in dialog;
AHP_AUTH_REQUIRED is retried silently in the background.

The local provider's auth autorun and the remote provider's
setConnection no longer pre-set `_cacheInitialized`; clearConnection
cancels any pending retry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix compile error: declare retry backoff statics before instance field

The static SESSION_REFRESH_RETRY_MIN_MS was referenced by the
_sessionRefreshRetryDelay instance field initializer but declared after
it, causing a 'used before its initialization' compile error under the
full tsc build.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* address review: guard _ensureSessionCache against redundant refreshes

With _cacheInitialized now staying false until a successful listSessions,
every synchronous getSessions()/getSessionByResource() during the failure
window would call _ensureSessionCache() and launch a fresh listSessions(),
bypassing the backoff and repeatedly hitting the agent/auth path. Add an
in-flight flag and skip _ensureSessionCache when a refresh is already
running or a backoff retry is already scheduled, so recovery only happens
via the backoff timer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#319183)

* ObjectMutationLog: recover from V8 max-string-length on stringify

JSON.stringify on the full session state (every 1024 mutations during
compaction) could exceed V8's ~512 MiB max string length when extensions
stored very large content in IChatAgentResult.metadata.toolCallResults
(notably Copilot's read_page tool can produce ~60 MiB browser dumps).
The thrown RangeError propagated up and lost the entire chat session.

Wrap the JSON.stringify(entry) calls in ObjectMutationLog with a catch
for RangeError that retries with a replacer truncating strings over
1 MiB and capping total at 100 MiB. The common path is a single
JSON.stringify with zero overhead; only failures pay the recovery cost.
Generic across the whole schema, so any future field that grows is
also protected.

Fixes #308843.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

(Written by Copilot)

* Address review: rename _BYTES -> _CHARS, tighten total-budget check

Copilot reviewer noted:
- Constants were named _BYTES but track string.length (UTF-16 code units),
  and the 'guaranteed to succeed' claim ignored JSON escaping and keys.
  Renamed to _CHARS and clarified that the budget is approximate.
- makeTruncatingReplacer checked total >= maxTotalChars *before* counting
  the current string, so one extra under-cap string could overshoot the
  cap. Now projects (total + val.length + 2) and emits the truncation
  marker if it would exceed the budget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

(Written by Copilot)
* New AH sessions should not show "Local"
Fix #314278

* More

Co-authored-by: Copilot <copilot@github.com>

* Update remote provider test for removed default description

(Written by Copilot)

---------

Co-authored-by: Copilot <copilot@github.com>
…ile on bwrap (#319061)

* Add bubblewrap sandbox capability remediation

* changes

* correcting wrong merge

* fix failing unit tests
…319181)

Enabling AllowNetwork option for retrying before running outside the sandbox,
@pull pull Bot locked and limited conversation to collaborators Jun 1, 2026
@pull pull Bot added the ⤵️ pull label Jun 1, 2026
@pull pull Bot merged commit cdea356 into code:main Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants