Skip to content

Merge main into feature/path-canonicalization-bugbash - #2823

Open
aws-toolkit-automation wants to merge 75 commits into
feature/path-canonicalization-bugbashfrom
autoMerge/feature/path-canonicalization-bugbash
Open

aws-toolkit-automation wants to merge 75 commits into
feature/path-canonicalization-bugbashfrom
autoMerge/feature/path-canonicalization-bugbash

Conversation

@aws-toolkit-automation

Copy link
Copy Markdown
Collaborator

Automatic merge failed

  • Resolve conflicts and push to this PR branch.
  • Do not squash-merge this PR. Use the "Create a merge commit" option to do a regular merge.

Command line hint

To perform the merge from the command line, you could do something like the following (where "origin" is the name of the remote in your local git repo):

git stash
git fetch --all
git checkout origin/feature/path-canonicalization-bugbash
git merge origin/main
git commit
git push origin HEAD:refs/heads/autoMerge/feature/path-canonicalization-bugbash

Rajanna-Karthik and others added 2 commits August 13, 2026 10:41
…d beam discovery/download (#2798)

* feat: scope local build verification to the loaded beamed repo and add beam discovery/download

* fix: only attach StepId to local-build-verification HITL when present

The beam LBV early-return always included a StepId field, so a HITL
with no stepId returned { HitlTag, TaskId, StepId: undefined }. The
existing unit test asserts the return deep-equals { HitlTag, TaskId },
which the extra key broke. Attach StepId only when defined so the
non-beam return shape is unchanged; beam jobs still carry the stepId.

* fix: address PR review — escape jobId, validate beam-map, guard zip-slip, tests

Addresses inline review comments on PR #2798:

- Regex injection/ReDoS: escape parentJobId before interpolating into
  new RegExp() in listBeamedRepos.
- Unvalidated beam-map JSON: shape-validate downloadJsonArtifact result
  (only objects yielding a non-empty repo name survive; malformed/null
  entries rejected + logged) before it drives artifact selection.
- Zip-slip: extractAllEntriesTo now resolves each entry against the
  extraction root and skips (logs) entries that escape via ../ or
  absolute paths. downloadBeamArtifact adds defensive destDir validation
  (rejects non-absolute, ..-containing, or empty paths).
- Backoff jitter: throttle retries use base * (0.5 + Math.random()).
- Typed contract: new BeamMapRepo / BeamedRepoInfo interfaces; listBeamedRepos
  returns Promise<BeamedRepoInfo[]>. Removes `any` from the beam discovery
  path.
- Bounded candidate scan: cap at BEAM_MAP_SCAN_MAX_CANDIDATES = 25 and
  BEAM_MAP_SCAN_BUDGET_MS = 15000 to keep listBeamedRepos responsive on
  artifact-heavy jobs.
- Shared scoped-HITL helper: selectScopedLbvHitl centralizes the
  scoped-LBV selection previously duplicated between getHitlAgentArtifact
  and the EXECUTING path.
- Central getStepId helper: single source of truth for the
  stepId ?? planStepId ?? parentStepId coalescing across all call sites.

Test coverage:
- New Beam to IDE unit suite for getStepId, normalizeBeamRepo, and
  listBeamedRepos (empty / beam-map / beam-status fallback / hash-suffix /
  regex-edge / send-failure), plus downloadBeamArtifact destDir rejection
  and a zip-slip regression test in utils.test.ts.

Deferred as tracked follow-ups (reviewer flagged non-blocking):
- Silent error swallowing → {repos, hadErrors}: return-shape change needs
  coordinated IDE-client update.
- Extract BeamRepoService: ~700-line refactor; hold for a dedicated PR to
  avoid pre-release regression risk on the shared handler.
… client (#2800)

* fix(amazonq): pass notification feature to the Q service manager (#2796)

The access-blocked notification added in #2794 never reached the client.
AmazonQServiceServerFactory destructures the features it forwards to the service
manager, and notification was not among them, so features.notification was always
undefined, the guard in serviceFactory never passed, onAccessBlocked was never
assigned, and the notifier could not run.

notification is optional on QServiceManagerFeatures so that existing constructions
and test fixtures keep compiling. That is also why omitting it here did not fail the
build -- it silently disabled client-facing reporting instead. Noted at the call site
so the next person adding a feature there does not repeat it.

Also set a stable id on the notification. Clients need to recognise it without
inspecting its text: the message is the service's own copy and is expected to change,
and FEATURE_NOT_SUPPORTED is reused across several RTS gates so the reason alone does
not identify this one. Both IDE clients already prefer the id when present and fall
back to matching the title only because the released server does not send one yet.

Verified: tsc clean, prettier clean, 6/6 notifier tests pass, and a server bundle
built from this branch contains the wiring where a bundle from the previous head did
not.

* fix(amazonq): declare serverInfo so notifications reach the client (#2797)

* fix(amazonq): declare serverInfo so notifications reach the client

The access-blocked notification still never reached the client after #2796. The
runtime only constructs a notification router for servers that declare serverInfo:

    if (initializeResult?.serverInfo) {
        this.notificationRouter = new RouterByServerName(initializeResult.serverInfo.name, ...)
    }

AmazonQServiceServer returned only capabilities and awsServerCapabilities, so the
router was never built and notification.showNotification() logged "Notifications are
not supported: serverInfo is not defined" and dropped the notification. Observed in
VS Code: the block was detected and logged, then silently discarded.

This is the last piece. With #2794 (detect), #2796 (wire) and this change (deliver),
a blocked identity produces a notification the client can act on.

Added a regression test, because the failure mode is silent: nothing throws and only
a debug line marks the loss. The test asserts the exact name, which is deliberate --
the name is encoded into the id of every notification the client echoes back, so
renaming it strands followups for notifications already on screen.

Note: amazonQServer.test.ts has one pre-existing failure on this branch,
"hooks onUpdateConfiguration handler to LSP server", present before this change
(6 passing/1 failing before, 7 passing/1 failing after). Left alone as unrelated.

* fix(amazonq): observe access-blocked on the streaming client too

The observer added in #2794 was only on the token client. Chat runs through the
streaming client, so the one surface where a blocked identity actually shows up to the
user was the one place nothing was watching. Detection happened to work anyway because
the gate denies every operation and the A/B config fetch goes through the token client
moments after credentials arrive -- but that is incidental, not a guarantee.

Mirrors the token client exactly: middleware on the outermost initialize step so it
fires once per operation after retries are exhausted, the observer is called inside its
own try/catch, and the error is always rethrown so callers behave as before.

The notifier is now created once per service generation and shared by both clients
rather than created per client. The notifier dedupes per instance, so sharing is what
keeps a blocked identity to a single notification no matter which client sees it first.
It is cleared by resetCodewhispererService, so signing out and back in with another
blocked identity notifies again instead of being suppressed.

Scoped to StreamingClientServiceToken. The IAM variant serves a different surface and
the gate only denies Builder ID, which is bearer-token only.

Pre-existing failures on this branch, unchanged by this commit: utils.test.ts 11
failing (89 passing) and amazonQServer.test.ts 1 failing, both identical before and
after.

* fix(amazonq): give the IAM and token servers distinct serverInfo names (#2799)

The serverInfo added in #2797 used one hardcoded name, but
AmazonQServiceServerFactory is instantiated twice -- AmazonQServiceServerIAM and
AmazonQServiceServerToken -- and runtimes including agent-standalone register both. Two
servers reporting the same name makes lspRouter reject initialize outright:

    Duplicate servers defined: AWS Language Server for Amazon Q Developer

That fails the whole language server, not just the duplicate. Observed in VS Code as:

    Failed to start downloaded LSP, falling back to bundled LSP:
    Duplicate servers defined: AWS Language Server for Amazon Q Developer

The client then silently ran its bundled server instead, so Q appeared to work while
none of the access-blocked reporting existed, with only a client-side warning to show
for it.

serverName is now a required parameter rather than a shared constant, since a default
is precisely what let two instantiations collide. The two names are exported so the
uniqueness is assertable, and they must stay stable: the name is encoded into the id of
every notification the client echoes back.

Added a regression test on the distinctness. Verified it bites -- reintroducing the
collision gives 7 passing/2 failing, the fix gives 8 passing/1 failing. No existing
test registers two servers from one runtime, which is why this reached a release.

Pre-existing failure on this branch, unchanged: amazonQServer.test.ts
"hooks onUpdateConfiguration handler to LSP server".

* test(amazonq): address review findings on the access-blocked observer (#2801)

Three review follow-ups, no behaviour change for users.

Name the streaming client's middleware, matching the token client. Without a name a
second registration stacks another observer rather than replacing the first, which would
report the same block twice, and the middleware is anonymous in SDK stack introspection.

Assert the server-name uniqueness against the real exported servers rather than the two
constants. Comparing constants cannot catch the same name being passed to both factory
calls, which is the mistake that actually shipped. Verified the test bites: making the
names identical fails it (7 passing/2 failing vs 8/1).

Add two tests for the streaming observer. They assert the wiring rather than the callback
because the existing harness stubs CodeWhispererStreaming.prototype.sendMessage, which
bypasses the middleware stack entirely -- a behavioural test there would pass even if the
middleware did not exist.

shared group: 337 passing / 45 failing, against 334 / 45 before, so the 3 new tests and
no new failures.
@aws-toolkit-automation
aws-toolkit-automation requested a review from a team as a code owner August 13, 2026 22:27
github-actions Bot and others added 27 commits August 13, 2026 15:39
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
…2838)

The repo moved from aws/language-servers to
Amazon-Q-Developer/language-servers (P490405625).

CODEOWNERS still referenced @aws/flare. Team grants do not follow a repo
across orgs, so GitHub cannot resolve that team and reviewer assignment
is broken while main still requires code owner review. Point it at
@Amazon-Q-Developer/sync-team-dae-production-eng-team, which has push
access on the repo.

The repository.url fields in all nine workspace package.json files also
still referenced the old org. Publishing uses OIDC trusted publishing,
which validates repository.url against the OIDC claims of the building
repository and generates provenance from them, so stale URLs fail the
publish step.
The token service issues its first service call from its constructor, and the service is
built lazily by whichever consumer asks first. That consumer is the chat webview finishing
boot, measured at ~0.66s after the credentials landed. Nothing contacts the service in
that window, so a rejected identity cannot be discovered and the user sits in front of a
chat view that is never going to work.

Uses onCredentialsUpdated, added in language-server-runtimes 0.3.21, to build the services
as soon as bearer credentials arrive. The dead code this replaces -- an `in` check plus an
`any` cast, added in #2521 -- was reaching for this event before the runtime had it, so it
never fired.

Reuses handleSsoConnectionChange rather than constructing anything, so this changes only
when initialization happens, not how:

- Idempotent. createCodewhispererServiceInstances records the connection type, so the
  consumer's later call short-circuits instead of resetting live services. This matters
  beyond tidiness: the event fires on every token refresh, and rebuilding would drop
  in-flight requests and replace the service that observers are attached to.
- IdC with developer profiles still stops at PENDING_Q_PROFILE and builds nothing, so no
  request is made before a profile is chosen.
- IAM updates are ignored.
- Failures are logged, not thrown: this runs inside the client's credentials request, and
  the lazy path still runs for whoever asks first, so a failure costs the head start only.

Checked for regressions rather than assumed: the opt-out header defaults to the
conservative value and configuration is read at onInitialized, long before sign-in, so an
earlier request cannot leak content for a user who opted out. getConnectionType is accurate
because the runtime awaits connection metadata before storing credentials.

One behaviour change worth noting: ProfileStatusMonitor.emitAuthSuccess, and therefore MCP
registry sync, now fires ~0.66s earlier.

Tests: AmazonQTokenServiceManager 40 passing/3 failing against 35/3 on main; shared group
342/45 against 337/45. The 3 and 45 are pre-existing and unchanged.
…em silently (#2841)

When a tool-use content block is streamed but the response ends before its terminating
`stop` event (e.g. the output-token limit is reached mid tool-input), the tool-use input
is never JSON-parsed and no error is recorded, so the parser reports success. The agentic
loop keeps only stopped tool uses as pending, so the unterminated one is filtered out, the
turn is reported as Succeeded, and the loop breaks -- the tool never runs and the user sees
no error or retry.

Add AgenticChatEventParser.finalize(), called once the response stream is fully consumed:
any tool use still lacking a stop is marked stopped and given an incomplete-input error
(reusing the malformed-JSON prefix) so it survives the pending-tool-use filter and is routed
into the existing recovery path, which re-prompts the model to split the work into smaller
tool uses. User cancellation is unaffected (aborts throw before finalize runs).
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: scope and forward stepId for the planning-branch lbv hitl

The AWAITING_HUMAN_INPUT path already scopes the local-build-verification
HITL to the loaded beamed repo and forwards its plan-step id, but the
PLANNING branch did neither: it picked the first LBV HITL in the list and
returned it without StepInformation. On a multi-repo beam where the job
sits in PLANNING at build time, that surfaces a sibling's (or untagged)
HITL, so the IDE scope guard cannot confirm ownership and defers the build
indefinitely.

Bring the PLANNING branch to parity with AWAITING_HUMAN_INPUT:
- prefer the in-scope LBV via selectScopedLbvHitl (no-op when scope is
  empty, so non-beam behavior is unchanged)
- forward StepInformation.StepId when present

Verified live on a 3-repo beam: each loaded repo now builds and siblings
are correctly deferred.

* fix: suppress out-of-scope sibling LBVs in the planning branch

Brings the PLANNING branch of getTransformInfo to full parity with the
EXECUTING / getHitlAgentArtifact paths for multi-repo beam. It already
preferred the loaded repo's in-scope LBV and forwarded its stepId, but it
did not suppress out-of-scope sibling LBVs: when scope was set with no
in-scope LBV it could still surface a sibling's LBV HITL to the IDE.

Mirror the sibling branches:
- when scope is set and every pending HITL is a sibling's LBV, return
  plan-only (surface nothing)
- otherwise drop out-of-scope LBVs from the fallback pool so a sibling's
  LBV can't be picked in a mixed pending set

Not a live false-green (the IDE scope guard already rejects a HITL whose
stepId is out of the loaded subtree) — this restores the LSP-side layer so
all three branches behave identically. Non-beam is byte-identical: the new
logic is gated on a non-empty beam scope.

* fix: harden beam LSP stepId coalescing and tidy beam docs

- getStepId uses || so an empty-string id falls through to the next spelling
  (was ?? which let an empty id defeat coalescing and scope matching)
- move the normalizeBeamRepo JSDoc onto normalizeBeamRepo
  (was stranded above getStepId)

* test: cover beam LBV planning-scope and getStepId coalescing

- PLANNING branch: a sibling repo's out-of-scope LBV is not surfaced
- getStepId: empty stepId falls through to planStepId/parentStepId (|| not ??)
…es in telemetry (#2847)

* fix(amazonq): only retry tool-use streams that were genuinely truncated

Treating every response stream that ends without a terminating tool-use `stop`
event as a truncated tool input is too broad. A stream also ends without `stop`
when the request is aborted (response-processing timeout or cancellation), and
when the model announced a tool use but streamed no input at all. Reporting those
as failures and re-prompting the model produces failed intermediate stream events
for turns that were not broken, and can re-run the agent loop without making
progress.

- finalize() now only reports an incomplete tool input when partial input was
  actually received and the request was not aborted; other unterminated tool uses
  are left unstopped and filtered out downstream, as before.
- The abort state is passed into finalize() from the response processor.
- Consecutive incomplete tool-use retries are now bounded
  (MAX_INCOMPLETE_TOOL_USE_RETRIES). On exceeding the limit the agent loop stops
  and surfaces an actionable error instead of retrying indefinitely.

Genuine truncation (partial input present, request not aborted) still routes into
the existing recovery path and is retried.

* fix(amazonq): allow 3 incomplete tool-use retries before giving up

* feat(amazonq): classify incomplete tool-use retries in invokeLLM telemetry

A response stream whose tool-use input is cut off is retried inside the agent
loop and usually recovers within the same user turn. Every one of those
iterations emits amazonq_invokeLLM with result='Failed', so a per-call success
rate built on that metric drops even though the user was unaffected.

Report a `reason` alongside the existing result so the two cases can be told
apart downstream:

  INCOMPLETE_TOOL_USE_RETRYING   retry budget remains; transient, recovers
  INCOMPLETE_TOOL_USE_EXHAUSTED  retries used up; the user sees an error

The classification is computed before the emit. Because the retry budget is
bounded, whether this iteration will be retried is already known at that point,
so no post-hoc correlation is needed.

result stays 'Failed' in both cases, so raw failure counts are unchanged and
remain available for diagnostics. Consumers can now exclude the transient class
from success-rate calculations while still counting the terminal give-up.

The reason values are consumed by ToolkitTelemetryLambda to emit a separate EMF
counter; renaming them requires updating that transform first.

Retry behaviour is unchanged: incrementing the counter before the emit and
testing `count <= MAX_INCOMPLETE_TOOL_USE_RETRIES` preserves the existing
off-by-one, so 3 retries still follow the initial failure.

* chore(amazonq): describe the telemetry reason consumer generically

The do-not-rename note on the reason constants pointed at a specific internal
consumer by name. Describe it as a downstream metrics pipeline instead: the
warning is what matters to anyone editing these values, and the constants are
part of a contract rather than a link to one particular implementation.

No functional change.
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
…bvPending (#2849)

- listBeamedRepos: derive repo name from both subdir (<repo>_<hash>/file.zip) and flat
(<repo>_<hash>[_suffix].zip) transformed-source shapes, so a flat-named repo is no
longer dropped from the beamed list.
- Add optional Lightweight param: the IDE poll-refresh sets it to skip the beam-map
download scan (throttle-safe); the IDE preserves stepId across lightweight ticks.
- Add IsLbvPending (beamed but LBV HITL not created yet) via isRepoLbvHitlPending, so
the IDE gates Load (IsLbvOpen && !IsLbvPending) until the HITL exists.
getTransformInfo already resolves the interactive mode from the job
objective (cachedInteractiveMode) but never returned it. Add the
InteractiveMode field to AtxGetTransformInfoResponse and populate it at the
getTransformInfo wrapper so the IDE can restore the correct mode after a
restart instead of trusting its local settings store.

Paired with the IDE change in aws-toolkit-visual-studio-staging.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
The prerelease workflow interpolated github.event values directly into
inline `run:` script bodies. Because GitHub substitutes those expressions
textually before the shell parses the script, a crafted branch name or
workflow input could terminate the surrounding quoting and run arbitrary
commands on the runner.

Move each untrusted value (inputs.tag_name, workflow_run.head_branch,
workflow_run.head_sha) into a step-level `env:` block and reference it as
a shell variable, so the value is always treated as data. This matches
the pattern the create-release job in this workflow already uses.

No behavior change: tag and prerelease names are unchanged for main,
feature/*, and release/agentic/* branches, and unsupported branches still
fail the same way.
…eps (#2857)

* feat(amazonq): render unit-test-generation substeps as status-only

Mark the direct substeps of the "Generate Unit Tests" step (plan / generate /
merge / coverage) as status-only so the IDE renders them as progress-only rows,
without a checkpoint toggle, "View Results" button, or checkpoint checkbox.

The step data returned by the service has no machine-readable step label, so the
flag is assigned structurally during plan-tree assembly based on the parent
step's name rather than a label prefix. The parent step keeps its normal
checkpoint affordance.

* feat: forward generate_unit_tests choice into ATX job objective (#2855)

Include GenerateUnitTests in the CreateJob objective only when it is a real boolean,

so clients that omit it keep legacy behavior and an explicit false stays a decline.

Matches shipped backend contract CR-298620129. Adds 4 unit tests.

---------

Co-authored-by: Meha Sharma <mehishar@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
Bind the customVersion and versionIncrement workflow_dispatch inputs to
step-level environment variables instead of interpolating them into the
inline shell script, so the values are passed as data rather than
expanded into the script source.
… throttle cooldown, reaped-beam drop-off (#2883)

* fix(beam): cache parsed beam artifacts so discovery stops re-downloading them

Beam discovery re-scans the same candidate artifacts on every sweep, and each
candidate was downloaded and re-parsed every time. Measured in one 90-second
window on a workspace with 32 jobs:

  1980  CreateArtifactDownloadUrl completed
  1230  "artifact is neither raw JSON nor a zip" parse failures
   295  listBeamedRepos calls
   217  CreateArtifactDownloadUrl AccessDeniedException

That is ~22 download-URL creations per second, sustained. The AccessDenied
errors were not confined to artifacts - ListMessages took the same error in
the same window, so this starves unrelated calls, chat included.

The existing bounds (BEAM_MAP_SCAN_MAX_CANDIDATES, BEAM_MAP_SCAN_BUDGET_MS)
limit ONE scan and are correct, but they reset per call and so cannot limit
the number of scans. Caching is what bounds the total.

Artifacts are immutable - a re-upload mints a new artifactId - so a cached
entry can never be stale. Keyed on artifactId, capped, and cleared wholesale
on overflow rather than evicting a chosen victim; the only cost of a clear is
downloading once more.

A cached `null` means "these bytes are definitively not JSON", which is the
case that dominated the waste (1230 of the failures). It also collapses that
log line from once-per-sweep to once-per-artifact.

Transient failures are deliberately NOT cached - a missing presigned URL, a
network or throttle error, an AccessDenied, or a malformed zip that makes
AdmZip throw. Caching one of those would permanently mark a readable
artifact unreadable.

Not changed here, deliberately:

- No result-level cache for listBeamedRepos. Its result genuinely changes as
  lbvOpen flips, and making that staler risks the LBV-open timing that the
  Load gate depends on. With artifact downloads cached, a repeat call is a
  single ListArtifacts plus cache hits.
- No name/extension prefilter on candidates. The code already documents why
  that regressed before: the beam-map is itself stored as a zip with a .zip
  path, so filtering on the extension skipped the beam-map entirely and fell
  back to zip-discovery with an empty stepId.
- No cadence change on the IDE side. Measure the effect of this first.

* fix(beam): correct the artifact cache - the cap was below the working set

The previous commit's cache did nothing. Built and run, the flood was
unchanged at ~1200 CreateArtifactDownloadUrl per minute, and the new
"caching as not-JSON" line fired 14649 times in 25 minutes.

Measured why, rather than guessing again:

  distinct artifacts touched   1043
  previous cap                  500
  wholesale clears in 25 min     36

The cap sat below the working set, so the cache filled, cleared everything,
refilled, and cleared again - discarding on every pass the entries that were
about to be hit. Hit rate approximately zero. It paid the bookkeeping and
delivered none of the benefit.

Two changes:

1. Cap 500 -> 4000, derived from the 1043 measurement rather than chosen.
   Redundancy in that session was ~29x (about 30000 downloads for 1043
   distinct artifacts), so a cache that actually holds the working set should
   remove most of the volume.

2. Evict ONE least-recently-used entry instead of clearing the map, and
   refresh an entry's position on a hit so the ordering is a true LRU (Map
   iterates in insertion order, so "oldest key first" is only correct if hits
   re-insert).

The eviction strategy is the part that mattered. Clearing wholesale turns an
under-sized cap from a partial loss into a total one: at the cap it discards
every entry including the ones in active use. Single-victim eviction degrades
gradually, so a workspace whose working set exceeds the cap still gets most
of the benefit instead of none.

The cap-reached notice is kept but latched to log once per process rather than
once per eviction - that signal is what made the under-sized cap diagnosable,
and per-eviction logging would itself become a flood.

Still to verify by measurement, not assertion: that this actually reduces the
download volume. The previous version looked correct and did nothing.

* fix(beam): stop the artifact cache assuming artifacts are immutable

The cache was keyed on artifactId with no expiry, justified by "a re-upload
mints a new artifactId". That is asserted nowhere in the platform contract,
and this file's own comments record the opposite: web-orc RE-WRITES the
beam-map ("re-written on each beam; latest wins"), and the BeamArtifactId
"thrash" that forced the beam-status fallback is the same observation. If a
rewrite reuses the id, a permanent cache pins the FIRST beam-map for the
whole LSP session — so a repo beamed later never appears in the panel until
restart, and a re-beam leaves chat routed at a dead stepId.

Split the policy by polarity instead, which needs no platform guarantee:

  negatives ("not JSON")  -> cached permanently; a property of the bytes,
                             and 1230 of the 1980 wasted fetches, so this
                             is where the win actually is
  positives (parsed)      -> 60s TTL; far longer than the ~13s sweep so the
                             repeated fetches still collapse, while
                             staleness is bounded to a minute

The TTL also bounds RETENTION: parsed values are arbitrary size, so without
one, customer artifact content stayed resident for the whole session.

Also label the beam discovery logs with their job id. One workspace commonly
holds several jobs containing the SAME repo names, so unlabelled per-repo
lines read as one repo changing state when they are really N jobs
interleaved — which produced a confident, wrong "lbvOpen is flapping"
diagnosis that was really four jobs each reporting correctly.

* fix(beam): stop skipPolling duplicating every message the user sends

The skipPolling early return handed back the raw sendResult, whose sent-message
id sits at `message.messageId`. The polling path below it returns
`data: { sentMessage: sendResult.message }`, and the client reads
`data.sentMessage.messageId` to add the id to its seen-set so its own 3s poll
does not re-render the message it just sent locally.

On the skipPolling path that read resolved to null, nothing was seeded into the
seen-set, and the poll then treated the user's own message as newly arrived — so
every beamed message appeared twice in the transcript.

Return the same shape the polling path returns. Regression from the skipPolling
change; only beamed sends set the flag, so only they were affected.

* fix(beam): pick the live beam node, and back off when throttled

Discovery matched a beamed repo by name and took the first hit. A repo
beamed more than once has more than one node under that name, and the
first is the oldest, so a re-beamed repo never came back - the IDE kept
resolving to a step that had already finished. Matching now collects
every node with that name and prefers one whose build-verification child
is still live, falling back to the newest. A matched node's subtree is
not searched again, so nested names cannot shadow their parent.

The beam-map scan also had no reaction to being throttled: it would
retry the same sweep on the next poll and keep the throttling alive.
It now sits out a cooldown longer than the poll interval, so whole
sweeps drop rather than being retried piecemeal. The cooldown empties
the candidate list instead of returning early, because returning early
would abandon beam-status discovery too and empty the tab for the whole
cooldown.

* fix: drop a reaped beam from the transferred list instead of showing it forever

A beam whose sub-agent never booted gets reaped by the web orchestrator:
the instance is stopped and the repo node marked terminal. The IDE kept
showing it, because the only signal read was the Local Build Verification
child - and a reaped beam has none, which is indistinguishable from a
fresh transfer whose HITL has not been created yet.

Read the repo node's own status to separate them. Terminal with no LBV
child means the beam ended without ever opening LBV, so it is closed.
Safe on re-beam: the orchestrator re-drives that node to IN_PROGRESS
before reusing it, so a re-beamed repo reads live again.

The user is otherwise left waiting on a repo that will never build - the
re-beam notice goes to the job owner, not to whoever is in the IDE.

* test: cover the reaped-beam gate in both directions

The terminal-repo-node branch had no behavioural coverage. Deleting it or
inverting it both left the suite green, so a passing run could not tell a
working gate from an unreachable one.

Four cases, mutation-verified: removing the gate fails two, over-gating
fails the third, and the fourth pins that an LBV child still decides when
one exists.
* fix(amazonq): stream large ATX artifact downloads to disk

downloadArtifactToPath buffered the whole artifact into memory via
got.get(responseType:'buffer') under timeout:{request:30000}. The
'request' timeout caps the ENTIRE request including body transfer, so a
large artifact (e.g. Transformation_Report.html) that takes >30s to
download aborts with a TimeoutError. That error was swallowed by the
catch and surfaced only as a generic download failure — matching the
customer report where CreateArtifactDownloadUrl succeeds but the report
never downloads (V2381716118).

Stream the presigned URL straight to disk with got.stream + pipeline,
and switch to inactivity-based timeouts (response 30s to headers, socket
60s idle) so a large-but-healthy download is no longer capped by wall
clock, and no longer double-buffered in memory. Add success/error
logging for diagnosability.

* fix(amazonq): log all downloadArtifactToPath failures with diagnostics

Every failure branch now logs clearly: the previously-silent missing-URL
branch logs an error, and the catch records the got error code, timeout
phase, HTTP status, bytes transferred before failure, and full stack.
* feat(chat-client): persist deprecation notice dismissal

* fix(chat-client): replace agentic feature card

* fix(chat-client): show deprecation notice once per instance

* fix(chat-client): finalize deprecation notice

* fix(chat-client): preserve deprecation notice on chat options

* fix(chat-client): show deprecation notice until acknowledged

* test(chat-client): document JSDOM Node global
…xists (#2886)

* fix(amazonq): forward the missing-packages HITL when a plan already exists

handleAwaitingHumanInput routes to handleExecutionPhaseHitl once a plan is
present, and that path only handles step-level ({stepId}-review) HITLs - it
never forwards HitlTag or MissingPackageJsonPath. A missing-packages HITL
raised after planning was therefore dropped on the way to the IDE, which
could not show the package-upload dialog. Only the planning path forwarded
those fields, so the defect appeared exactly on longer jobs where the plan
already existed.

Return the HITL directly when it is reported, mirroring the existing
local-build-verification early-exit, and log the resolved json path.

Client-side handling of this HITL is P516058803.

* test(amazonq): cover missing-packages HITL passthrough when a plan exists

Verified against the unfixed handler: the two plan-exists cases fail without
the passthrough (the tag and MissingPackageJsonPath are dropped by
handleExecutionPhaseHitl) and pass with it. The no-plan case passes either way,
confirming the planning path was never affected - which matches the reported
job, where the language server forwarded the HITL correctly.
…fact, not the job objective (V2381727290) (#2887)

* fix(amazonq): keep interactive_mode when a checkpoint sync omits it (V2381727290)

checkpoint-settings.json is full state: it is uploaded as a HITL artifact and the
agent applies whatever it contains. The agent reads a missing interactive_mode as
"use the default" (interactive) rather than "leave the mode alone", so any writer
that omits the key silently reverts the user's mode - absent is not unchanged.

setCheckpoints only attached interactive_mode when the caller supplied one, which
was safe while the IDE attached a mode to every periodic checkpoint sync. It is
not safe once a caller legitimately has no mode to assert: on a gamma job the
user switched to autonomous at 07:16:57Z, the agent picked that up and ran
autonomously from 07:18:34Z, and a later checkpoints-only sync uploaded a settings
artifact with no interactive_mode - flipping the agent back to interactive at
07:22:52Z.

Carry the last written mode forward when the caller does not supply one, so a
checkpoints-only sync preserves the mode instead of dropping it. An explicit mode
still wins. Unrecognised or corrupt persisted values are ignored rather than
echoed to the agent, and reading them never fails the sync.

This is the writer-side half. The agent treating absence as "keep current" is the
matching robustness fix and is tracked separately, as is the read path: the LSP
still restores the mode from objective.interactive_mode, which is the immutable
job-creation payload, so a mid-job switch cannot survive an IDE restart until the
service exposes the effective mode. Deliberately not sourcing that from the local
file this change reads - it would go stale whenever the mode is changed outside
this IDE.

* fix(amazonq): restore the mode from the settings artifact, not the objective (V2381727290)

The mode reported to the IDE after a restart came from objective.interactive_mode.
The objective is the payload the job was CREATED with and is never rewritten, so a
mid-job switch was silently discarded: reopening the IDE always came back in the
mode the job started in. Switch to autonomous, reopen, and the hub showed
interactive again.

A mode change is written to the checkpoint-settings HITL artifact instead, and
every client that changes the mode writes it - this IDE, another IDE, or the web
UI - so it is both current and shared. Read the mode from there and keep the
objective as the fallback for a job whose mode was never changed and so has no
artifact yet. An artifact that carries no usable interactive_mode also falls back
rather than guessing.

The read reuses the existing download path and stays one-shot, gated on the same
cachedInteractiveMode latch as before, so it costs one extra list plus download
per job on the first poll rather than one per poll.

Worth recording why the local checkpoint-settings.json this handler already writes
is NOT used as the source: it only sees switches made from this IDE on this
machine, so preferring it would report a stale mode whenever the mode was changed
elsewhere - trading a known bug for a harder cross-client one.

* fix(amazonq): keep the cached mode in step with an asserted switch

Two gaps found reviewing the earlier commits on this branch.

setCheckpoints never updated cachedInteractiveMode, so after a mid-job switch the
cache still held the job-start value - and that cache is what getTransformInfo
reports back to the IDE on every poll. Nothing broke only because the IDE applies
the restored mode once and then ignores later values; the correctness of a switch
should not rest on that latch. Update the cache when a mode is asserted.

The carry-forward then reads that cache in preference to the local
checkpoint-settings.json. The file only records switches made from this machine, so
a mode changed from the web UI would have been overwritten with a stale local value
by the next checkpoint sync - turning the carry-forward into the very kind of
silent revert it was added to prevent. The cache is seeded from the settings
artifact, which every client writes, so it does not have that blind spot. The file
stays as the fallback for a process that has not yet resolved a mode.

* fix(amazonq): key the interactive-mode cache by job (review feedback)

The cache was a single field on a handler that outlives any job, reset only on a
terminal status or a new startTransform. That used to be a display bug at worst.
With the carry-forward added earlier on this branch it is not: a checkpoint-only
sync writes the cached mode into the job's settings artifact, and the agent treats
that artifact as authoritative - so with two jobs open, the first job's mode could
be written into the second job's artifact and change how it runs.

Keyed by job id now, and the job-start write moved after createJob so the id exists
to key on. clearJobCache drops only the entry for the job it was called with; every
caller already passes one.

Also records where each cached mode came from, so the carry-forward log names it.
Carrying forward a mode that came from the job-creation objective asserts the job's
starting mode rather than a real choice, which is only correct while no switch has
happened - and that is the known-limitation path where findCheckpointSettingsHitl
misses, which was previously indistinguishable in a log.

Two tests cover the reported scenario: a sync for job-2 does not write job-1's
cached mode, and each job keeps its own asserted mode. Reverting the job scoping
fails the first with job-1's mode present in job-2's artifact.

* docs: trim the mode-cache comments

Comment-only. Condenses the carry-forward and cache-declaration comments, and records
the one known limitation in a line rather than a paragraph: the cache is resolved once
per job, so a switch made elsewhere afterwards is overwritten by the next sync.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dungdong-aws and others added 30 commits October 8, 2026 15:26
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This merges the released changes for 1.81.0 into main.
… S3 RequestTimeout (#2926)

* making artifact upload process a worker task

* fix(amazonq): upload transform artifact from a worker thread to avoid S3 RequestTimeout

The artifact upload ran on the language server's main thread, which it shares
with the workspace indexing library. The 30-minute index refresh blocks that
thread for up to a minute or more on large workspaces; during that time no
upload bytes are sent, S3 closes the PUT with 400 RequestTimeout, and
StartTransform fails with Failed to upload ZIP file to S3.

Move the PUT into a worker_threads worker so it keeps streaming while the main
thread is busy. uploadArtifact's signature and return contract are unchanged.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
…n tests

GitHub retired the macos-13 hosted runner image on 2025-12-04. Jobs that
request it are never picked up: the mac-x64 Agent Server Tests job sits
queued with no steps until the workflow's 24h limit cancels it.

macos-15-intel is GitHub's supported Intel (x86_64) macOS label, which
keeps the mac-x64 target covered.
* fix(amazonq): keep OAuth token requests on validated endpoints (#2950)

* fix(amazonq): refine path and command handling (#2949)

* fix(amazonq): propagate path resolution errors

resolveSymlinkAwarePath recovered from lstat and realpath failures by
returning the path it was given. Propagate those errors instead, and treat
only ENOENT as a not-yet-created path, so callers can distinguish a
resolved location from one that could not be resolved. A symlink cycle is
reported as ELOOP.

* fix(amazonq): refine command handling

* fix(amazonq): extend command handling checks

* test(amazonq): compare emitted command status
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
* fix: stop pinned context leaking to new chat windows (#2786)

addPinnedContext aliased the shared module-level DEFAULT_PINNED_CONTEXT
array and then mutated it with unshift/push. Pinning context in one tab
therefore polluted the default, so every new chat window inherited that
pinned item and it could not be removed. getPinnedContext also returned
the shared default array directly.

Copy the default array in both places so pinning in a tab no longer
mutates the shared default. Adds a regression test.

(cherry picked from commit e311389)

* fix(amazonq): stop memory bank analysis from blocking the language server (#2927)

The memory bank TF-IDF step stored dense, vocabulary-wide vectors and built a
union Set of both vectors for every one of the N^2 file pairs. On a large
workspace this ran for over a minute synchronously on the language server
event loop, so other requests, such as a new chat tab's pinned context and
rules, were not handled until it finished.

- Build sparse TF-IDF vectors with precomputed norms, count document
  frequency once per document, and compute only the upper triangle of the
  cosine matrix. Results are unchanged.
- Yield to the event loop periodically during the analysis.
- Fix the "20KB" size filter, which compared line counts instead of
  characters and let multi-megabyte single-line files through.

* refactor(amazonq): clarify cosine similarity variable names

(cherry picked from commit c812bea)

* fix(amazonq): match recorded approvals for Windows paths(#2939)

isPathApproved normalized separators with a pattern that only matched
doubled backslashes, so Windows paths never matched approvals recorded
for a parent folder or for the same path in a different separator form.
Normalize separators and compare paths consistently, and add tests for
multi-path reads and Windows-style paths.

(cherry picked from commit a4941a4)

* fix(amazonq): restore MCP permissions for legacy and duplicate servers (#2936)

MCP 'Always Allow' reverted to 'Ask' after every restart or MCP refresh for
servers declared in a legacy mcp.json. updateServerPermission writes the
'@server/tool' entries into agents/default.json but deliberately omits the
server definition, while loadAgentConfig only re-applied '@'-prefixed entries
while iterating the same file's mcpServers block. Legacy servers have no such
entry, so their permissions were dropped on every load; duplicate
workspace/global servers hit the same gap because they 'continue' before the
permission pass.

Stash server-scoped permission entries during the per-file pass and drain them
for every server that actually loaded, once agent, legacy and registry servers
are all known.

(cherry picked from commit 1dd3702)

* fix(amazonq): honour configured MCP tool call timeout (#2935)

* fix(amazonq): pass configured MCP timeout to the SDK request options

MCP tool calls were capped at the SDK's 60s default request timeout because
McpManager.callTool never passed RequestOptions to client.callTool. A
configured timeout above 60s only armed the outer Promise.race, which can
shorten but never extend the deadline, so the SDK cancelled first with
'MCP error -32001: Request timed out'. timeout: 0 ('no timeout') was capped
at 60s for the same reason.

Resolve the effective timeout once and hand it to the SDK, mapping 0 to the
largest value setTimeout honours and falling back to the 60s default (with a
warning) for negative, non-finite or over-large values.

* test(amazonq): type MCP warning logger arguments

(cherry picked from commit 92ca072)

* fix(amazonq): say so when a request fails on a usage limit (#2938)

A usage-limit condition surfaced as the bare 'Request failed after 3
attempts', which is indistinguishable from generic retry exhaustion. The
actionable text ('Monthly limit reached') exists only in ResponseError.data,
so clients that surface ResponseError.message - as the Eclipse plugin does
when the structured payload is absent - told the user nothing, prompting
logout/reinstall cycles for an account quota.

Name the cause in the message while keeping the attempt count for support.

(cherry picked from commit 4fa62f7)

* chore(chat-client): use Mynah UI 4.40.5 beta (#2955)

(cherry picked from commit d8759bb)

* fix(amazonq): mark oversized file context as truncated instead of cutting silently (#2871)

File content added as chat context is capped at workspaceChunkMaxSize with a plain substring, so the model receives only the beginning of large files and has no way to know the file continues. It then reports the wrong file size (e.g. "this file only has 251 lines") instead of reading the rest with its tools.

Add truncateContextContent() which appends an explicit truncation marker (including the real character count) while keeping the result within the same size budget, and use it for innerContext in AdditionalContextProvider. Add unit tests.

(cherry picked from commit 2fa2737)

* chore(chat-client): bump mynah-ui to 4.40.5

(cherry picked from commit 5be2d6b)

---------

Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
#2948)

* feat(amazonq): add IAM (SigV4) auth path for AWS Transform FES calls

Parallel to the existing IdC bearer flow: the IDE pushes IAM credentials via
aws/credentials/iam/update and the tenant URL via aws.atx configuration, and
the language server SigV4-signs FES calls when both are present. Bearer path
unchanged.

- AtxTokenServiceManager: getAuthType(), getIamCredentials() (reads the main
  credentials provider's iam slot), IAM-aware hasValidCredentials(), and an
  applicationUrl setting on the aws.atx section.
- atxTransformHandler: addAuthToCommand() SigV4-signs on the IAM path (service
  transform, region from the tenant URL), headers set case-insensitively
  before signing; verifySession() validates IAM credentials on that path;
  not-signed-in fails before any network call. Secret-safe logging.
- Declare @smithy/signature-v4 and @aws-crypto/sha256-js.
- Tests for auth-type/credential/tenant-URL handling and bearer vs IAM vs
  not-signed-in signing.

* feat(amazonq): clear AWS Transform IAM session on IAM credentials delete

On aws/credentials/iam/delete the runtime clears the IAM credentials slot. The
AWS Transform service manager now also clears the IAM tenant URL and resets its
cached FES client, so no IAM session state is kept after sign-out. Uses the
existing runtime notification; no new LSP method.

- amazonQServer forwards IAM credential deletions to AtxTokenServiceManager.
  Bearer deletions keep their existing handling.
- AtxTokenServiceManager handles IAM deletion. The bearer token is untouched.
- Tests for the cleared state, bearer token unaffected, and IAM-only forwarding.

* feat(amazonq): honor client declared AWS Transform auth mode

Add an aws.atx authType setting (iam or bearer) that the client sends with
each sign-in. When declared, getAuthType reports only that mode, so stale
credentials of the other type are never used to call FES. Switching to
bearer clears the IAM tenant URL and resets the cached FES client through
the same path as the IAM credentials delete. The IAM credentials delete
also resets a declared iam mode.

Without a declared mode the auth type is derived from the credentials
present, as before.

* feat(amazonq): add AWS Transform session validation command

Add aws/atxTransform/validateSession, a read-only check the client runs
before reporting IAM sign-in as connected. It makes one ListWorkspaces call
with maxResults 1 through the same signing, tenant URL and permission path
as real requests, and never goes through the create path.
listOrCreateWorkspace is unchanged.

Failures are classified where the typed SDK error is available, into
ExpiredCredentials, MissingPermission, TenantNotFound, NetworkOrService or
Other. The response carries only the reason, error name and HTTP status,
and only those are logged, never the error message or credential values.

FES returns AccessDeniedException for expired or invalid security tokens
and for signature mismatches, so AccessDeniedException is checked against
reason INVALID_SESSION and two fixed AWS phrase lists, kept together in
atxSessionValidation.ts. A signature mismatch is reported as Other.

* fix(amazonq): classify SigV4 INVALID_SESSION errors instead of reporting expired

FES returns AccessDeniedException with reason INVALID_SESSION on the SigV4
path for several cases that are not expired credentials, so session
validation showed an expired message for all of them.

- New reasons, matched on the FES message (lowercase phrase match):
  - IamAuthNotEnabled: SigV4ProfileResolutionHandler, SigV4 access is not
    enabled for this profile (IAM authentication off in the Transform
    profile settings).
  - IamAuthNotEnabledForAccount: SigV4FeatureFlagHandler, SigV4 access is
    not enabled for account.
  - TenantMismatch: SigV4ProfileResolutionHandler, credentials do not match
    the provided tenant.
- Expired and invalid security token phrases still map to
  ExpiredCredentials, and signature mismatch still maps to Other.
- INVALID_SESSION with an unrecognized message now maps to Other instead of
  ExpiredCredentials. If FES rewords a message, it falls back to Other.
- The FES message is never logged or returned (the account message contains
  the account ID); only the reason, error code and status are.

Tests for each reason, the fallbacks, and that no message text or account ID
leaks into the result or the log.

* fix(amazonq): return error code and status for failed AWS Transform commands

Failed AWS Transform commands returned only an error flag and message, so
the IDE could not tell AccessDenied apart from other failures and kept
polling. Add errorCode and statusCode to the error result, and return the
GetJob error code and status with JOB_NOT_FOUND. The error message is
unchanged and never parsed by the client.

* fix(amazonq): validate the AWS Transform tenant URL for IAM (SigV4) auth

The aws.atx application URL is kept only when it is an https AWS Transform URL in a
region with an FES endpoint, reduced to its origin. On IAM, the region comes only
from a valid URL (no default region fallback), and requests are not signed without
one. The IdC path is unchanged.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
* fix(lsp-yaml): load the schema once instead of on every request

YamlLanguageService called configure() before every hover, completion,
validation and format request. configure() clears the schema cache, so
each request downloaded and parsed the 17.5 MB SAM schema again. This
made the CloudFormation completion integ test exceed its 8s timeout on
Windows runners.

Configure the service once in the constructor with the same settings
and a '*' file match, so the schema is fetched and resolved once per
server process.

* fix(lsp-yaml): reload the schema after a failed load

Loading the schema once means a failed load stayed cached for the life of
the process. Before, the per-request configure() cleared the cache, so the
next request fetched the schema again.

Record when the resolver throws, returns content that is not JSON, or the
default fetch gets a non-OK response, and re-run configure() on the next
request in that case only. A successful load is still fetched once, and
the returned content and diagnostics are unchanged.
Node.js 24.9.0 is affected by CVE-2026-111497, which is fixed in
Node.js 24.22.1. The 24.9.0 pin was a temporary workaround for a
Node.js release issue that has since been resolved.
…able (#3027)

A daily workflow now opens a draft pull request that updates NODE_SEMVER
when Node.js publishes a newer release on the bundled major line, after
checking the new files against their published checksums.

download-node.sh now verifies the SHA-256 of each file, stops on HTTP
errors, and stops when a platform file is missing from the release.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix(identity): validate section and setting names when saving profiles

- Accept only the profile and sso-session settings that the store
  loads.
- Require section names that the AWS SDK reads back as the same
  section.
- Write each section header and setting on a single line.

* fix(identity): preserve shared config file modes when saving

- Create the rewritten file with the mode of the file it replaces, or
  0600 for a new file.
- Keep credentials files owner-only, including the backup.
- Create a new shared config directory with 0700.

* fix(amazonq): limit diff and similarity work for large edit suggestions

- Compute the accepted-edit character diff with two rows instead of a
  full table, skip the common prefix and suffix, and approximate it
  when the table would exceed 1,000,000 cells.
- Compare rejected edits by edit distance only up to 2,000 characters.
  Longer edits match only an identical rejection, which is unchanged
  for the default threshold of 1.0.

* fix(amazonq): keep workspace rule resources inside the workspace

- Load absolute resource paths only from the global agent config.
- Load workspace rule files only from inside the workspace folder.
- Log each resource that is skipped.

* fix(amazonq): reserve built-in tool names for MCP tool registration (#2982)

* fix(amazonq): reserve built-in tool names for MCP tool registration

MCP tool names came from a server's tools/list and were used in their
bare form whenever the name was not already in the collision set. That
set was not seeded with the built-in tool names, so a server could
register under one and replace the built-in entry.

createNamespacedToolName now takes a reservedNames set, never returns a
reserved name from any naming branch, and discards a persisted name
mapping that points at one. Both call sites seed the set from
agent.getBuiltInToolNames() so the reservation tracks tool registration.
MCP cleanup paths skip built-in names.

* fix(amazonq): dispatch tool confirmation on the registered tool name

processToolConfirmation resolved its switch subject as toolType ||
toolUse.name. The MCP branch passes the server's original tool name as
toolType for display, so a tool advertised as fsRead selected the
built-in fsRead card, which reads input.paths and threw "Paths array
cannot be empty." before any approval card was shown. The same name
also drove the isStandardTool classification and the executeBash body
check.

Dispatch and classification now use toolUse.name, the registered name,
which is namespaced for MCP tools. toolType stays display-only.

* fix(amazonq): guard optional tool name in confirmation classification

ToolUse.name is string | undefined, so the isStandardTool check needs
the undefined guard that the previous expression carried. Restores it
on the dispatch name. An undefined name classifies as non-built-in.

* test(amazonq): cover reserved built-in names in MCP tool naming

Adds cases for every built-in name, two servers advertising the same
built-in name, re-registration reusing the namespaced name, truncation
of a long server name, the numeric-suffix fallback skipping a reserved
candidate, and the default empty reserved set keeping prior behavior.

* test(amazonq): cover sanitized names that collapse onto a built-in name

sanitizeName strips disallowed characters, so an advertised name such as
"fs Read" becomes "fsRead". The reserved check runs on the sanitized
form; this pins that behavior.

* fix(amazonq): key remaining tool-name branches on the registered name

getUpdateToolConfirmResult resolved its subject as originalToolName,
which is the server's original tool name on the MCP approval path. A
tool advertised as executeBash therefore rendered the shell card, which
reads input.command, and one advertised as a filesystem tool selected
those cases. Dispatch now uses toolUse.name; originalToolName and
toolType remain display-only. The built-in path already passes
toolUse.name, so built-in rendering is unchanged.

getMessageIdForToolUse no longer branches on toolType, so a server
cannot steer a card to the built-in executeBash message id. The
parameter is now unused and is removed.

The Built-in tool list in mcpEventHandler selected tools by excluding
raw MCP tool names, which hid a built-in whose name an MCP server also
advertises. It now selects by getBuiltInToolNames().

* fix(amazonq): keep unclassified tools in the Built-in list

The previous commit selected the Built-in list purely by
getBuiltInToolNames(), which dropped the three LSP tools that register
without a ToolClassification and were previously listed.

The filter is now additive: a built-in is always listed, and any other
tool is listed unless it matches an MCP tool name. The MCP name set also
includes the namespaced names tools are actually registered under, so a
colliding MCP tool is excluded rather than appearing alongside the
built-in it shadowed.

* test(amazonq): cover MCP tools whose name matches a built-in tool

Drives processToolUses with an MCP tool registered as probe___fsRead
whose server-advertised name is fsRead, and asserts the server's name
never selects built-in behavior: the confirmation card is the MCP
summary card rather than the built-in read card, the built-in path
validation error does not surface, the MCP permission is consulted
under the server and original tool name, runTool receives the
registered name, and the accepted-result card is the MCP card.

A second case registers probe___executeBash and asserts no card renders
as the shell command card and the confirmation uses the plain
toolUseId rather than the shell tool's message id.

* fix(amazonq): reserve statically dispatched tool names

* fix(amazonq): require workspace containment before opening chat card files (#2906)

* fix(amazonq): require workspace containment before opening chat card files

onFileClicked passed card paths to showDocument with no containment
check. The fsRead branch opened params.filePath directly, the default
branch opened params.fullPath directly, and resolveAbsolutePath joined a
relative filePath onto the workspace root, so a traversing relative path
escaped as well. Card paths originate in model tool results and service
findings, so a manipulated response plus one click opened any readable
file and fed it to completion context.

All three open paths now go through openIfAllowed, which canonicalizes
the path and reuses requiresPathAcceptance: a file opens only when it is
inside a workspace folder or the user already approved it for the card's
tool in this session. The user prompts directory is allowed for
.prompt.md files, which resolveAbsolutePath deliberately resolves there.
Refused clicks are logged and otherwise ignored.

Tests cover an inside file, an outside fullPath, an escaping relative
path, an fsRead card for an unapproved and an approved outside path, an
fsWrite approval not unlocking an fsRead card, a prompt file in the
prompts directory, and a non-prompt file in that directory.

* fix(amazonq): prompt before opening an out-of-workspace chat card file

The previous commit refused such opens outright and only logged. A card
can legitimately point outside the workspace, for example a findings
path the user wants to inspect, so the open is now gated by a warning
dialog instead of dropped.

openIfAllowed shows a showMessageRequest warning with Open and Cancel
when requiresPathAcceptance requires acceptance. The message leads with
the specific reason the check returned, such as the sensitive-file
warning, and names the canonical path. Choosing Open records the path
for the card's tool in the session's approved paths, so a repeat click
or a later tool use on the same path does not prompt again. Cancel or
dismissal aborts the open. In-workspace, already-approved, and prompt
directory paths open without a dialog as before.

MessageType and MessageActionItem are imported from the protocol module,
which already supplied MessageType to this file; a second import from
server-interface produced a duplicate identifier.

Tests cover the dialog contents and action order, Open opening the file,
Cancel and dismissal refusing, the choice being remembered across
clicks, the sensitive-path reason surfacing in the dialog, and existing
approvals suppressing the dialog.

* fix(amazonq): normalize Windows paths in approval lookup

Match single backslash separators consistently with session approval storage.
Normalize Windows paths before sensitive-location pattern checks.
Add session round-trip tests for drive and UNC paths and use native separators
in the sensitive-path fixture.

* fix(amazonq): open file links from chat answers in the editor (#3016)

* fix(amazonq): open file links from chat answers in the editor

* fix(amazonq): handle Windows file links

* fix(amazonq): detect sensitive Windows paths

* fix(amazonq): separate file-open consent

* fix(amazonq): refine chat file-link handling

- Keep encoded '#' and '?' in file names and accept 'file.ts:10' line suffixes.
- Tell the user when a link is not opened or a linked file is not found.
- Keep link-click telemetry for links handled inside chat.
- Retain an fsRead Open choice only for paths an fsRead call requested, and say so in the dialog.

* fix(amazonq): bound not-found message and match home-relative fsRead paths

* fix(amazonq): retain fsRead Open choice only for regular files

* fix(amazonq): check regular files with node fs for fsRead retention

* test(amazonq): cover forward-slash and ~user fsRead inputs

* fix(amazonq): require exact approval for sensitive paths

- Credential and system paths need their own approval, not a parent
  directory's. This also applies to the executeBash working directory.
- A file with more than one hard link needs approval in fsRead, fsWrite,
  fsReplace and grepSearch, and as an executeBash file argument. An
  approval covers such a file only while it is the same file with no
  more names.
- Keep executeBash file checks for approved paths.
- Record an approved path after the tool succeeds, and for executeBash
  only when the command exits normally. An executeBash approval allows
  the working directory only for an out-of-workspace prompt of a
  read-only command, and never the home folder, a folder above it, or a
  hidden or settings folder.

* fix(amazonq): show the full command in shell command cards

- Use a code block fence that is longer than any run of backticks in the
  command, in the approval card and the other shell command cards.

* fix(amazonq): ask before modifying workspace configuration files

- Ask before fsWrite or fsReplace modifies files in .amazonq, .vscode,
  or .git folders in the workspace, including linked folders, the
  AmazonQ.md rules file, or the global Amazon Q configuration when the
  workspace includes it.
- Memory bank generation can still write its own files, only in the
  request that asked for the memory bank.

* test: run every unit test file to completion

* feat(amazonq): start local MCP servers only in trusted workspace folders (#3019)

* fix(amazonq): explain why local MCP servers wait for workspace trust (#3039)

List servers held by the workspace trust check under "Waiting for trust"
with what starts them, instead of under Disabled, and keep such a server
when it is saved.

* fix(amazonq): stricter checks for chat file links and configuration files (#3042)

fix(amazonq): stricter checks for chat file links and configuration files

---------

Co-authored-by: hezelin <hezelin@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix(amazonq): apply the configured ignore patterns to local indexing

* fix(amazonq): read MCP tool permissions from the file that owns the server (#3054)

* fix(amazonq): read MCP tool permissions from the file that owns the server

Server-scoped tools/allowedTools entries ('@server', '@server/tool') are now
applied to a server only when they come from the global agent config or from
the agent config that its permissions are saved to: the file that declares
the server, or the agents/default.json next to a legacy mcp.json. Ownership
is decided after all servers have loaded, so a later legacy mcp.json
definition is taken into account.

* test(amazonq): cover MCP Always Allow surviving a restart for each config location

* fix(amazonq): compare MCP permission file paths case-insensitively on Windows

Workspace config paths built from a file URI get a lowercase drive letter,
while other callers can pass the original casing, so the same file did not
match and its permissions were not applied.

* fix(amazonq): apply MCP permissions only from the file that owns the server

Global entries no longer apply to a workspace server that replaces a global one.
Load and save share one mcp.json to agents/default.json mapping.

* fix(amazonq): require a web URL for the MCP OAuth authorization endpoint (#3061)

* fix(amazonq): require a web URL for the MCP OAuth authorization endpoint

Check the discovered authorization endpoint with the same HTTPS-or-loopback
rule used for the token endpoint before asking the client to open it.

* fix(amazonq): listen for the MCP OAuth callback before opening the browser

* fix(amazonq): log MCP settings and server launches without env and header values (#3059)

The MCP settings click log keeps the event and its form values, with env
variable and header fields reduced to their names. The server start log
lists the command, the number of arguments and the env variable names,
and the connect log lists the URL origin.

* fix(amazonq): keep more MCP server setting values out of the language server log (#3076)

---------

Co-authored-by: hezelin <hezelin@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…eneration and validation (#3074)

* feat(amazonq): send generate_integration_tests and browser in ATX CreateJob objective (#2962)

Forward the customer's "Generate and run integration tests on this machine"
choice and the detected local browser from the StartTransformRequest to the
ATX job objective.

- StartTransformRequest: optional GenerateIntegrationTests and Browser {Type, Version}
- createJob: writes generate_integration_tests only when it is a real boolean
  (an explicit false is a decline; absent keeps legacy behavior), and
  browser {type, version} only when well-formed
- Objective key names live in ATX_OBJECTIVE_GENERATE_INTEGRATION_TESTS_KEY /
  ATX_OBJECTIVE_BROWSER_KEY; the integration-test key is pending the Transform
  agent's C1 confirmation
- Unit tests for createJob objective and startTransform forwarding

* feat(amazonq): add ITGen test-run and app-launch models (contract v0 draft) (#2967)

* feat(amazonq): add ITGen test-run request and summary models (contract v0 draft)

TypeScript mirror of the VS extension's AtxTestRunRequest / AtxTestRunSummary
for the ITGen integration-test HITL payloads (ITGen–IDE contract v0, schema
1.0). Not wired into any handler yet.

- AtxTestRunRequest: top-level artifactId (repo artifact holding the generated
  test projects, re-downloaded per request) and localFolder; side decides
  where the app starts (original: upload copy, transformed: solution), so no
  source code is downloaded. ATX_TEST_RUN_BASE_URL_ENV = AB_BASE_URL is set by
  the IDE on the port it picks.
- AtxTestRunSummary: status, appUrl, startedAt/finishedAt, durationSeconds,
  counts, failingTests.
- isSupportedAtxTestRunSchemaVersion: accepts the same major version as
  ATX_TEST_RUN_SCHEMA_VERSION (1.x); rejects other majors and malformed values.
- Unit tests with a real Bob's Used Bookstore run reshaped to the contract.

* feat(amazonq): add ITGen app-launch request and result models (contract v0 draft)

TypeScript mirror of the VS extension's AtxAppLaunchRequest / AtxAppLaunchResult
for the integ-app-launch HITL (transformed-code run contract, Taskei P541522260,
merged into P541522201).

- AtxTestRunApp extracted so the test-run and app-launch requests share it.
- AtxAppLaunchRequest: side, project, attempt, app (proposal; contract v0 §6
  defines only the result). Like LBV's rounds, the number of attempts is the
  agent's decision, so there's no limit field.
- AtxAppLaunchResult: status STARTED | APP_NOT_STARTED, appUrl,
  healthCheck {path, httpStatus}, error, logFile, durationSeconds.
- Unit tests with Bob's Used Bookstore's real first launch.

* refactor(amazonq): trim ITGen test-run and app-launch requests to the fields the IDE needs

Mirror of the VS extension change (contract v0 review, 10/23):

- AtxTestRunRequest: schemaVersion, runId, side, project, artifactId,
  tests.projectPath, limits.projectTimeoutSeconds. Dropped round, localFolder,
  app, env and limits.maxResultZipMB.
- AtxAppLaunchRequest: app is now AtxAppLaunchApp {webProject,
  healthCheckPaths?, startTimeoutSeconds?}; dropped host.

* feat(amazonq): ITGen test HITL handlers, any-depth diff apply, completeHitlWithTestResults (behind ATX_ITGEN_ENABLED) (#2976)

* feat(amazonq): apply ITGen step diffs at any plan depth behind ATX_ITGEN_ENABLED

With integration tests on, the agent nests LBV under local-verification
(CR-315347405), so LBV error-fix rounds move to depth 3 and are never
applied, while the nested LBV step (depth 2, no diff) is reported as a
failed apply on every poll.

Behind the new ATX_ITGEN_ENABLED flag (stand-in for the row 18 feature
flag), completed steps are selected by having a step-tagged
CUSTOMER_OUTPUT artifact rather than by depth: one paginated job-wide
ListArtifacts call, only when a SUCCEEDED step still needs a download.
Steps without an artifact are skipped, not failed; steps apply in tree
post-order. With the flag off, the depth-2 behavior is unchanged.

* feat(amazonq): add ITGen test HITL handlers and completeHitlWithTestResults behind ATX_ITGEN_ENABLED

Language-server side of the ITGen-IDE contract v0 (sections 3-6), all
gated on ATX_ITGEN_ENABLED; with the flag off every path is unchanged.

- HITL selection: integ-app-launch, then integ-test-run, after LBV and
  missing-packages and before *-checkpoint, at all three selection sites.
  integ-* HITLs are returned with their StepId on the EXECUTING, PLANNING
  and AWAITING_HUMAN_INPUT paths, never treated as a plan-review ZIP.
- getTransformInfo returns OpenHitls[] (TaskId, Tag, StepId, expiry),
  built from the ListHitls the poll already made. For integ-* HITLs the
  agent's request is saved once per task to
  artifactWorkspace/<job>/hitl/<taskId>/request.json and rejected
  (RequestError) when the schemaVersion major isn't 1. For integ-test-run
  the repo artifact with the generated tests is downloaded again for every
  task into itgen/<runId>/tests (TestsPath), since the agent rewrites it
  under the same id. Agent-supplied ids used as folder names are checked.
- New aws/atxTransform/completeHitlWithTestResults: checks the result ZIP
  holds summary.json (test run) or launch-result.json (app launch) with a
  supported schemaVersion, uploads it as HITL_FROM_USER, completes the
  upload and submits the task by id (SubmitCriticalHitlTask).

* feat(amazonq): align ITGen test HITLs with contract v0 schema 1.1

Follows the 10/26 contract update (interactive app launch):

- completeHitlWithTestResults adds the customer's changed files to every
  transformed-side result ZIP (launch and test run) as
  workspace/metadata.json + workspace/<relative path>, with the same scan
  and metadata as updateWorkspace (tracked files modified since job
  start). The IDE's ZIP is left as it is; a copy is uploaded. Original
  side results are uploaded unchanged.
- AtxAppLaunchResult gains optional launchedBy ('ide' | 'customer').
- NOT_LOCALHOST is removed from AtxTestRunStatus (published URLs are
  allowed on the original side).
- ATX_TEST_RUN_SCHEMA_VERSION is 1.1 (1.0 payloads are still accepted).
- The side comment now says the original runs from artifactWorkspace/before/.

* feat(amazonq): remove earlier ITGen runs' tests and validate tests.projectPath (#2988)

* feat(amazonq): keep only the ITGen test project per run and drop earlier runs' tests

The integ-test-run tests artifact is the repo artifact, which can hold the
whole repo. Extract it to a staging folder and keep only the folder of
tests.projectPath (falling back to the whole artifact, with a warning, when
that folder isn't in it). Refuse a rooted or climbing tests.projectPath.
Once a run's tests are in place, remove the tests of earlier runs of the
same side and project; their run folders (with the result ZIPs) stay.

* fix(amazonq): keep the whole ITGen tests artifact so project references resolve

A generated test project can reference other projects in the artifact (for
example a common library from the source repo) and rely on its root build
files (Directory.Build.props, Directory.Packages.props, nuget.config), so
filtering to the test project's folder could break its build. Extract the
whole artifact in its own layout again; earlier runs' tests are still removed,
so a job keeps one copy per project. Warn when tests.projectPath isn't in the
artifact, and keep refusing a rooted or climbing tests.projectPath.

* fix(amazonq): guard ITGen test cleanup against overlapping downloads

Address review on #2988:
- Overlapping polls for the same task now share one download, and only the
  newest run started for a side and project collects earlier runs, so a late
  duplicate or stale download can't delete the current run's tests.
- No marker and no cleanup when the request has no side or project.
- Reusing tests downloaded before tests.project existed backfills the marker.
- The comment and test fixture describe independent test projects (contract
  decision 16), not tests that reference application source.

* feat(amazonq): download a beamed repo's original code to artifactWork… (#2987)

* feat(amazonq): download a beamed repo's original code to artifactWorkspace/before (ITGen)

Adds aws/atxTransform/downloadOriginalCode and OriginalArtifactId on the beamed-repo
record, so the IDE can fetch a beamed repo's pre-transformation source by its
codeArtifactId. It extracts into artifactWorkspace/before, the folder the IDE copies a
local job's original to and the ITGen coordinator reads from. One copy per solution,
tagged with a job marker; stub Directory.Build.*/Directory.Packages.props stop MSBuild
importing the transformed solution's files. Staged extract + rename, so a failed
download never looks complete.

* fix(amazonq): downloadOriginalCode rejects only real '..' segments (ITGen)

A folder name like 'Foo..Bar' in the solution path was rejected as traversal.

* fix(amazonq): make the beamed original download safe to reuse, replace and repeat (ITGen)

From the Code Review Sage review of #2987:
- The marker records the job AND the original-code artifact; a copy is reused only when
  both match (a web job has one original per repo, and an original can be re-saved). An
  older plain-text marker is treated as no match.
- Replacing a copy no longer deletes it in place: the old marker goes first, the old copy
  is moved aside, the new one is renamed in, and the old one is deleted best-effort. A
  copy that is only partly replaced is never reused; if the new copy can't be moved in,
  the old one is put back without its marker.
- Calls for the same solution are queued and each extracts into its own staging folder,
  so two Loads can't corrupt each other; a queued duplicate reuses the finished copy.
  Leftover staging/aside folders are cleaned up on the next call.
- The job id is checked with the shared isSafePathSegment; the comment no longer claims
  it reaches a path.

* fix(amazonq): gate the original-code download on ATX_ITGEN_ENABLED, tidy its file handling

- downloadOriginalCode refuses unless ATX_ITGEN_ENABLED is on, like completeHitlWithTestResults
- one isSafeAbsolutePath check ('..' segments only) for beam and original-code folders
- clear leftovers before the reuse check; match only before.partial-* / before.old-*
- async rename/rm in the swap and cleanup

* feat(amazonq): send ITGen generate_ui_tests and generate_api_tests in ATX CreateJob objective (#3020)

* feat(amazonq): send ITGen generate_ui_tests and generate_api_tests in ATX CreateJob objective

The IDE start dialog now has a Verification checkbox with three
sub-options: Generate unit tests, Generate UI tests and Generate API
tests (ITGen-IDE contract v0, section 1). Forward the two new choices
from the StartTransformRequest to the ATX job objective.

- StartTransformRequest: optional GenerateUITests and GenerateApiTests
- startTransform forwards them to createJob
- createJob writes generate_ui_tests / generate_api_tests only when they
  are real booleans (an explicit false is a decline; absent, as from
  older IDEs, keeps today's objective)
- generate_integration_tests and browser are unchanged: the IDE sends
  integration = UI || API and only sends the browser for UI tests
- Unit tests for the objective keys and startTransform forwarding

* fix(amazonq): name the ITGen start-dialog group Validation in comments

Review follow-up (#3020.1): two new comments called the group "Verification".
The IDE (toolkit #2998) and the contract call it "Validation".

* fix(amazonq): only send ITGen keys in the CreateJob objective when ITGen is on

createJob wrote generate_integration_tests, generate_ui_tests,
generate_api_tests and browser into the ATX job objective whether or not
ATX_ITGEN_ENABLED was on, while the other ITGen paths in the handler
check isItGenEnabled(). Gate all four behind isItGenEnabled() so a
client that sends them can't change job objectives where ITGen is off.

generate_unit_tests stays ungated. It is the separate unit-test
generation choice, shipped on main before ITGen, and is not
part of ITGen.

With ITGen on, the keys are forwarded as before, with the same
boolean-only rule. Tests cover both states, including explicit false
choices and a flag value other than exactly "true".

Refs: #2857

---------

Co-authored-by: David Topchyan <davetop@amazon.com>

* feat(amazonq): generate_integration_tests is the only ITGen key and gate (remove UI/API keys and ATX_ITGEN_ENABLED) (#3024)

* feat(amazonq): make generate_integration_tests the only ITGen objective key

The team agreed (11/02) that generate_integration_tests is the only ITGen
switch in the ATX job objective; the Transform agent ignores
generate_ui_tests and generate_api_tests, and the IDE start dialog keeps one
integration-tests checkbox. Remove the two keys added in #3020: the
StartTransformRequest fields, their startTransform forwarding, and the
createJob writes. generate_integration_tests and browser are unchanged and
still gated on ATX_ITGEN_ENABLED.

* feat(amazonq): gate ITGen on the job's generate_integration_tests instead of ATX_ITGEN_ENABLED

Remove the ATX_ITGEN_ENABLED environment variable. The LS now runs its ITGen
code only for jobs whose objective has generate_integration_tests: true:
ITGen HITL selection and OpenHitls, completeHitlWithTestResults, diffs at any
depth, and downloadOriginalCode. Every other job behaves as before ITGen.

- createJob always writes generate_integration_tests when the client sends a
  real boolean, and browser only with integration tests. It remembers the
  job's flag, so no extra call is needed for jobs this LS created.
- For other jobs (resume, job history, beam) the flag is read once from the
  job objective: getTransformInfo asks GetJob for the objective until the job
  is known, and isItGenJob does the same outside a poll. A failed GetJob isn't
  cached.

* refactor(amazonq): move the ITGen job gate to its own module and bound it

- ItGenJobGate (itgenJobGate.ts) owns the per-job generate_integration_tests
  flag: createJob records it, other jobs are read once from their objective,
  and a failed read isn't remembered.
- The map is capped at 200 jobs (oldest dropped) and a job is forgotten in
  clearJobCache, on terminal statuses and stop.
- No per-poll shared flag: each check looks up its own job id, so overlapping
  getTransformInfo calls for different jobs can't read each other's value.

* fix(amazonq): keep each ITGen project's test runs in its own folder (#3031)

* fix(amazonq): keep each ITGen project's test runs in its own folder

The agent can use the same run ids (r1, r2, p1) for every project of a solution, so a
later project's run unpacked its tests over an earlier project's. Test-run tests now go
to artifactWorkspace/<job>/itgen/<project>/<runId>/tests (itgen/<runId>/tests when the
request has no project), and only the project's own earlier runs are cleaned up. A
project that isn't a single folder name is refused.

* fix(amazonq): return the plan while an executing job waits on chat

handleAwaitingHumanInput took a job for one still being planned unless its first
top-level step had sub-steps. When that step is a leaf (for example "Assess Solution"),
an executing job waiting on a chat question went down the planning path, which returns
no plan, so the IDE kept showing a stale plan. A plan now exists once any top-level
step has sub-steps.

* Revert "fix(amazonq): return the plan while an executing job waits on chat"

This reverts commit 4e2e6edddc7cb0d0519bb00ef70423df80140e91.

* fix(amazonq): give any ITGen project name a safe folder, and reword internal references

- An empty project is no project. A project name that isn't a plain folder name (a
  space, parentheses, a leading underscore, a Windows device name, a trailing dot) gets a
  safe folder with a hash of the name, so its test run still works instead of failing.
- Comments in atxTransformHandler.ts describe past issues without internal ticket ids or
  customer names.

* fix(amazonq): keep returning the plan while a job waits on chat or a step review (ITGen) (#3021)

* fix(amazonq): keep returning the plan while a job waits on chat with no HITL open (ITGen)

handleAwaitingHumanInput chose the planning phase whenever the plan's first top-level
step had no sub-steps. When a job is AWAITING_HUMAN_INPUT with no HITL open, the agent
is waiting on a chat answer (for example "anything else, or mark the job complete?" at
the end of the job). The planning branch returns no TransformationPlan, so the IDE
stopped seeing step statuses: with ITGen it never saw Local Verification finish, and
the apps it had launched kept running while the job waited on chat.

With no HITL open and a plan that has steps, take the execution path, which returns the
plan. A planning HITL (plan review) carries a tag, so it still takes the planning path.

* fix(amazonq): take the execution path for step reviews, not for a failed HITL lookup (ITGen)

handleAwaitingHumanInput picks the planning or execution phase from the plan's shape (does the
first step have sub-steps?), and the previous commit made an exception for "no HITL open". Two
gaps remained:

- A step review HITL ({stepId}-review) on a plan whose first step has no sub-steps still took
  the planning path, which returns no plan and no StepInformation, so the IDE couldn't show the
  step review. A HITL whose tag is the review tag of a step in the plan now takes the execution
  path, whatever the plan's shape.
- getHitlAgentArtifact returns null both when no HITL is open and when the lookup fails, so a
  failed ListHitls was read as "no HITL open". During plan review that skipped the planning
  path, which looks the HITL up again and so usually recovers in the same poll.
  getHitlAgentArtifact now reports a failed lookup to callers that ask (optional `lookup`
  argument), and the no-HITL exception applies only when ListHitls answered with nothing open.

* test(amazonq): cover the sibling-repo LBV case of "no HITL to surface" (ITGen)

getHitlAgentArtifact also returns null, without setting lookup.failed, when the request is
beam-scoped and the only open HITLs are local-build-verification HITLs outside the scope (a
sibling repo's, on a multi-repo beam job). handleAwaitingHumanInput reads that as "no HITL to
surface" and returns the plan alone, as the EXECUTING and PLANNING branches already do for that
case. Before this PR, a plan whose first step has no sub-steps sent it down the planning path,
whose lookup isn't beam-scoped, so the response carried the sibling's tag without its step id or
the plan.

The behaviour doesn't change. This documents the case in getHitlAgentArtifact's JSDoc and in the
phase comment in handleAwaitingHumanInput, renames noHitlOpen to noHitlToSurface, and adds tests:
- handleAwaitingHumanInput, through the real getHitlAgentArtifact: a beam-scoped request whose
  only open HITL is a sibling's LBV, on a plan whose first step has no sub-steps, gets the plan
  and no HitlTag, HitlTaskId or StepInformation, and ListHitls is called once. Fails against
  feature/ITGen-RIV, where the planning path returns the sibling's tag.
- getHitlAgentArtifact: that case returns null and leaves lookup.failed unset.

* chore(amazonq): remove internal ticket references and a customer name from netTransform (ITGen)

This repo is public. Comments in atxTransformHandler.ts and atxTransformHandler.test.ts cited
internal ticket references and named a customer. Each comment keeps its technical meaning: the
ticket references are dropped, and the customer is now "a customer-reported edit clobber". The
applyChanges test fixture's job id is now 'job-edit-clobber'.

Comments and a test fixture id only; no behaviour change.

---------

Co-authored-by: David Topchyan <davetop@amazon.com>

* feat(amazonq): model the 1.1 testOrder field on the test-run request and summary (#3032)

## Problem

`atxModels.ts` says its ITGen interfaces "match C# AtxTestRunRequest /
AtxTestRunSummary ... in the VS extension", but neither has the
`testOrder` field schema 1.1 sends, and the `AtxTestRunRequest` docblock
still lists only `AB_BASE_URL`, `AB_SIDE` and `AB_RUN_ID` as the
variables the IDE sets.

Nothing breaks today: the agent's `request.json` is downloaded and
handed to the IDE by path, and a TS interface is compile-time only, so
`JSON.parse` keeps `testOrder` whether it's declared or not. But the two
copies of the contract that claim to match each other now differ, so the
next change here that types or validates these payloads would drop a
field the agent relies on.

## Changes

- `AtxTestRunRequest.testOrder?: string` — optional, added in 1.1.
  `pre_run_loop.py` sends it as `default`, `reverse` or
  `shuffle:<seed>`; the agent asks for a second order before it freezes
  a suite, so the IDE sets `AB_TEST_ORDER` from it.
- `AtxTestRunSummary.testOrder?: string` — echoed back.
  `evaluate-pre-run-request.schema.json` says "Write testOrder in
  summary.json when the run used AB_TEST_ORDER", and EVALUATE_PRE_RUN
  tells the two orders of a suite apart by it.
- The `AtxTestRunRequest` docblock now lists `AB_SCREENSHOTS_DIR` and
  `AB_TEST_ORDER` alongside the three it already named.

Types only — no handler reads or writes these fields, and
`completeHitlWithTestResults` is untouched.

## Testing

- New `atxModels.test.ts` case: a request with `testOrder: 'reverse'`
  round-trips through JSON with the field, and one without it serializes
  no `testOrder` key (a 1.0 payload).
- `atxModels.test.ts`: 11 passing.
- `tsc --noEmit` on `aws-lsp-codewhisperer`: clean.

## Related

- aws-toolkit-visual-studio-staging#3011 is the IDE side that reads
  `testOrder` and sets `AB_TEST_ORDER`, `AB_SCREENSHOTS_DIR` and the
  corrected `AB_SIDE`. The two are independent: #3011 works without this
  (the field arrives in `request.json` either way), and this is types
  only.

* feat(amazonq): run ITGen for beamed repos that opt in via the beam-map (#3033)

* feat(amazonq): run ITGen for beamed repos that opt in via the beam-map

- BeamedRepoInfo.GenerateIntegrationTests from the beam-map entry (false on the beam-status path)
- the parent web job counts as ITGen when any beamed repo opts in; a beamed poll reads the
  beam-map in the background, so it survives an LS restart without delaying the poll
- beamed sessions never surface or list a sibling repo's integ-* HITLs
- downloadOriginalCode also writes .atx-job-id (plain job id), which the VS coordinator checks

* fix(amazonq): move the beamed-repo ITGen gate into ItGenJobGate and address review

- ItGenJobGate.isBeamItGenJob: capped like the job map; retries after 60s when the beam-map
  wasn't read (throttle cooldown, scan cut short); background read failures are logged
- scope the planning-phase HITL lookup so a sibling repo's HITL isn't picked there either
- read and write the original-code markers with fs.promises

* feat(amazonq): apply a beamed repo's post-beam step diffs and track the customer's changes (#3037)

* feat(amazonq): apply a beamed repo's post-beam step diffs and track the customer's changes

- a beamed poll applies completed step diffs under the loaded repo's card (not LBV, not pre-beam)
- an opted-in beamed repo gets the customer-changes manifest on its first poll
- integ-* HITLs aren't surfaced while a beamed job's gate is unknown
- a beam-map without an opt-in isn't re-read this session; no worklogs without a solution root
- completeHitlWithTestResults uses the beam-aware gate

* fix(amazonq): address review of the beamed-repo downlink

- the repo card's own step isn't applied, only the steps under it (beamApplyStepIds)
- the step selection and the manifest file walk move to beamRepoFiles.ts, with unit tests
- the manifest is written in the background, once for overlapping polls
- a NuGet packages folder is skipped, a source folder named packages isn't
- tests: a customer edit after Load reaches workspace/, a failed beamed apply marks only that step

* fix(amazonq): track a beamed repo's changes before the first apply

Address the second review of the beamed-repo downlink:
- An apply waits for the pending customer-changes manifest write, so the
  files it adds (for example a generated test project) are tracked.
- Every loaded beamed repo gets the manifest, opted in or not, matching the
  downlink, which applies post-beam steps to each of them.
- One Local Build Verification check (case-insensitive, anywhere in the
  name) for the downlink selection and the handler's LBV lookup.
- The manifest walk skips a folder it can't read instead of failing, and
  logs when it stops at the file cap.

* fix(amazonq): read every ITGen beam-map, and retry one that can't be downloaded (#3040)

* fix(amazonq): retry the ITGen beam-map read when a candidate can't be downloaded

A beam-map that's listed but can't be downloaded (ResourceNotFound until the
web side publishes it to the user-facing bucket) was treated as "not the
beam-map". The scan then counted as complete, and the gate cached "not opted
in" for the session. Now, without a beam-map read, an undownloadable
candidate makes the answer "can't tell", which the gate retries, and the scan
logs a warning naming the artifacts.

* fix(amazonq): back off the beam-map retry and warn once per job

Address the review of the beam-map retry:
- The gate doubles the wait after each read that couldn't tell (60 s up to
  15 min) and starts over once it gets an answer, so beamed sessions whose
  beam-map can't be downloaded don't rescan every minute.
- The scan warns once per job and set of undownloadable candidates.
- Say why a beam-map that was read decides, and test a failed download.

* fix(amazonq): merge every beam-map and cap the reads that can't tell

- The web writes a new beam-map on each beam batch, and ListArtifacts order
  isn't chronological, so keeping the last one listed could drop the repos
  of a later batch. Merge every beam-map; per repo, the newest entry wins.
- After 5 beam-map reads in a row that couldn't tell, treat the job as not
  opted in for the session (logged once), instead of retrying forever: a
  beam-map the service doesn't publish never becomes downloadable.

* fix(amazonq): count only unconfirmed beam-map reads towards the cap

Address the second review of the beam-map retry:
- The beam-map reader tells "unconfirmed" (the scan finished without a
  beam-map while a candidate went unread) from "not read" (throttled, cut
  short, or failed). Only unconfirmed reads back off and count towards the
  cap; a read that didn't happen is retried every 60 s, as before.
- A scan that left candidates past the 25-candidate cap and read no
  beam-map is unconfirmed, not "not opted in".

* fix(amazonq): unconfirmed only for finished scans, and without an opt-in read

Address Xuening's review of the beam-map retry:
- A throttle during the scan makes it unfinished, like the throttle
  cooldown: retried, never counted towards the cap.
- A beam-map that was read but doesn't opt in no longer decides while
  another candidate went unread: that one can be a newer beam-map that opts
  in, so the answer is unconfirmed.
- Only a finished scan with an answer clears the warn-once record, and the
  record is keyed by the sorted artifact ids.

* fix(amazonq): keep directories out of the transform source files manifest (#3052)

* fix(amazonq): keep directories out of the transform source files manifest

A Web Site project's ProjectPath is its folder, so it went into source-files.json as a file: it could show up as a modified file and break the review uplink zip. The manifest now leaves out any path that is a directory, a checkpoint never adds one, and getModifiedFilesSinceCheckpoint never reports one, also from a manifest written before this change.

* fix(amazonq): check only project paths for folders, without a blocking stat

Review on #3052: the folder filter called fs.statSync on every listed path on the startTransform request path. writeSourceFilesManifest is now async and checks only ProjectPath entries, the only ones that can be a folder (a Web Site project), with fs.promises.stat. updateSourceFilesManifest no longer stats; getModifiedFilesSinceCheckpoint, which already stats each path, now counts only files (isFile, as listBeamRepoFiles does), so a folder a checkpoint adds is never reported as modified.

* fix(amazonq): scan beam-map before beam-status in multi-repo beams (#3057)

* fix(amazonq): scan beam-map before beam-status in multi-repo beams

For a multi-repo beam with N repos, ListArtifacts returns N beam-status-*
JSON files plus the actual beam-map. The candidate scan tried them in
arbitrary order within a 15 s budget; with many candidates the beam-map
could fall outside the budget or be throttled, leaving the scan without
the map and causing the IDE to load repos without their original artifact id.

Two changes:
- Skip candidates whose path matches beam-status-*; they never hold the
  beam-map and each wasted candidate narrows the scan budget.
- Sort remaining candidates by path length, shortest first (pathless
  candidates first). The beam-map has no path in ListArtifacts, so it
  is now always tried first.

* fix(amazonq): move BEAM_STATUS_RE inline, use binary sort key, add test

Address code review findings on fix/beam-map-scan-priority:
- Remove function-scope BEAM_STATUS_RE variable; use the literal inline.
- Replace raw path-length sort key with binary pathless/has-path predicate
  so only the pathless vs has-path distinction is expressed, not arbitrary
  ordering within the has-path group.
- Add test: 3 repos, 3 beam-status-* artifacts listed before the pathless
  beam-map — the beam-map is still found first because status files are
  excluded from allCandidates.

* fix(amazonq): treat scan timeout as unconfirmed, add budget test, scan-summary log

Root cause confirmed from box logs (job 401bf8f4): tfm= is empty on ALL lines
across 13 hours of 30-s rescans for the 3-repo beam. The beam-map was never
read because the old code included 8 beam-status-* JSON files as scan candidates;
each download consumed ~2 s of the 15 s budget, leaving none for the pathless
beam-map listed last.

Three additions on top of the beam-status filter + pathless-first sort fix:

1. Scan timeout -> 'unconfirmed' (not undefined)
   readBeamOptIn now returns 'unconfirmed' when discoverBeamedRepos reports
   scanAborted (scanCutShort=true). The gate counts this toward
   beamMaxReadsThatCannotTell (5) and uses exponential back-off (60s, 120s,
   240s, ...), so a job that genuinely cannot serve its beam-map gives up
   after ~16 minutes instead of retrying flat forever. A throttle mid-scan
   stays undefined (not counted) since it is a transient infrastructure hiccup.

2. New test: 8 beam-status files + 1 pathless beam-map, each download "takes"
   2s (sinon fake clock). After the filter fix only 1 candidate remains (the
   beam-map); 1 download is attempted, scan not cut short, repo returned with
   GenerateIntegrationTests=true.

3. Scan-summary INFO log
   One [BEAM-PKG] scan-summary line per discoverBeamedRepos call: result label
   (found-opted-in / unconfirmed / timed-out / throttled-during-scan /
   not-opted-in / no-scan), candidate count, unreadable count, beam-map found,
   repos returned.

* fix(amazonq): throttle mid-scan also counts as unconfirmed (gap from review)

A throttle that fires during the beam-map candidate scan makes the scan just
as incomplete as a budget timeout — the beam-map may not have been reached.
Extend scanAborted to include throttledDuringScan so the gate uses exponential
back-off in both cases rather than retrying flat every 60 s forever.

Update the existing test that expected undefined for the throttle case to
expect 'unconfirmed'.

* fix(amazonq): retry transient CreateArtifactDownloadUrl errors and surface the reason

A Load failed 118 ms after start with "No presigned URL for beam artifact"
and the same Load succeeded minutes later: a transient non-throttle error
on the first CreateArtifactDownloadUrl call returned null with no retry,
and the caller replaced the real reason with a fixed string.

- createArtifactDownloadUrl: also retry transient errors (5xx,
  InternalServerException, ServiceUnavailableException, network errors,
  "unknown error") with the same jittered backoff and 4-attempt cap.
  Not found / access denied / validation / other 4xx still fail at once;
  throttle handling is unchanged. A response without a URL is retried
  once, then returns null.
- Remember the last failure reason per artifact; downloadBeamArtifact and
  downloadOriginalCode now return "Could not get a download URL for the
  ... (<ErrorName>: <message>)" or "The service returned no download URL
  for the ...". URLs are stripped from the message. Other callers still
  get null as before.
- Tests for retry classes, attempt counts and the surfaced error.

* fix(amazonq): address review: explicit opt-in on aborted scan, log unknown download-URL errors, keep transient reason

- readBeamOptIn: a beam-map read before the scan was cut short that opts
  a repo in now returns true (was 'unconfirmed'), and remembers the
  opt-in itself instead of relying on discoverBeamedRepos' side effect.
  discoverBeamedRepos returns optInFound for this.
- classifyDownloadUrlError: any 5xx is transient whatever its name. An
  unrecognized service error is still treated as permanent, but is
  logged once per name ("[BEAM-PKG] CreateArtifactDownloadUrl:
  unrecognized error name=<X> status=<code> - treated as permanent").
- When an attempt fails and the last one returns no URL, the earlier
  reason is kept: "The service returned no download URL for the beam
  artifact (after an earlier error: <Name>: <message>)". The reason is
  cleared on success.
- downloadBeamArtifact returns ErrorCode 'InvalidDestination' for a
  refused destination, so the IDE doesn't have to match the message.
- Tests for each.

* fix(amazonq): retry AccessDenied UnknownError on download URL

CreateArtifactDownloadUrl treated every AccessDeniedException as permanent, so a
denial with no real reason (message "UnknownError") failed the original-code
download on its first attempt, though the same artifact downloaded fine minutes
later. An AccessDeniedException or 403 whose message is empty or "UnknownError"
is now classified as throttling: it gets the same bounded jittered retry (4
attempts) and starts the 90 s beam-map scan cooldown, since a call storm has
also provoked such denials. One with a real reason stays permanent.

* chore: merge main into feature/ITGen-RIV (brings AWS Transform IAM auth) (#3053)

* chore(release): release packages from branch main (#2959)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.83.0 (#2973)

Co-authored-by: aws-toolkit-automation <>

* chore: merge feature/OHI fixes to main (#2978)

* fix: stop pinned context leaking to new chat windows (#2786)

addPinnedContext aliased the shared module-level DEFAULT_PINNED_CONTEXT
array and then mutated it with unshift/push. Pinning context in one tab
therefore polluted the default, so every new chat window inherited that
pinned item and it could not be removed. getPinnedContext also returned
the shared default array directly.

Copy the default array in both places so pinning in a tab no longer
mutates the shared default. Adds a regression test.

(cherry picked from commit e31138996f5720cf2b7244afdba05f897026ed3e)

* fix(amazonq): stop memory bank analysis from blocking the language server (#2927)

The memory bank TF-IDF step stored dense, vocabulary-wide vectors and built a
union Set of both vectors for every one of the N^2 file pairs. On a large
workspace this ran for over a minute synchronously on the language server
event loop, so other requests, such as a new chat tab's pinned context and
rules, were not handled until it finished.

- Build sparse TF-IDF vectors with precomputed norms, count document
  frequency once per document, and compute only the upper triangle of the
  cosine matrix. Results are unchanged.
- Yield to the event loop periodically during the analysis.
- Fix the "20KB" size filter, which compared line counts instead of
  characters and let multi-megabyte single-line files through.

* refactor(amazonq): clarify cosine similarity variable names

(cherry picked from commit c812bea34018486f3e7026da74fc480682d50591)

* fix(amazonq): match recorded approvals for Windows paths(#2939)

isPathApproved normalized separators with a pattern that only matched
doubled backslashes, so Windows paths never matched approvals recorded
for a parent folder or for the same path in a different separator form.
Normalize separators and compare paths consistently, and add tests for
multi-path reads and Windows-style paths.

(cherry picked from commit a4941a4f5cab5f1f40d03ce8eb05f7ca280eba57)

* fix(amazonq): restore MCP permissions for legacy and duplicate servers (#2936)

MCP 'Always Allow' reverted to 'Ask' after every restart or MCP refresh for
servers declared in a legacy mcp.json. updateServerPermission writes the
'@server/tool' entries into agents/default.json but deliberately omits the
server definition, while loadAgentConfig only re-applied '@'-prefixed entries
while iterating the same file's mcpServers block. Legacy servers have no such
entry, so their permissions were dropped on every load; duplicate
workspace/global servers hit the same gap because they 'continue' before the
permission pass.

Stash server-scoped permission entries during the per-file pass and drain them
for every server that actually loaded, once agent, legacy and registry servers
are all known.

(cherry picked from commit 1dd370212771dfe33a36d352059063fa61ffa4ef)

* fix(amazonq): honour configured MCP tool call timeout (#2935)

* fix(amazonq): pass configured MCP timeout to the SDK request options

MCP tool calls were capped at the SDK's 60s default request timeout because
McpManager.callTool never passed RequestOptions to client.callTool. A
configured timeout above 60s only armed the outer Promise.race, which can
shorten but never extend the deadline, so the SDK cancelled first with
'MCP error -32001: Request timed out'. timeout: 0 ('no timeout') was capped
at 60s for the same reason.

Resolve the effective timeout once and hand it to the SDK, mapping 0 to the
largest value setTimeout honours and falling back to the 60s default (with a
warning) for negative, non-finite or over-large values.

* test(amazonq): type MCP warning logger arguments

(cherry picked from commit 92ca07299c7453601498bb70d459236b6f7707bf)

* fix(amazonq): say so when a request fails on a usage limit (#2938)

A usage-limit condition surfaced as the bare 'Request failed after 3
attempts', which is indistinguishable from generic retry exhaustion. The
actionable text ('Monthly limit reached') exists only in ResponseError.data,
so clients that surface ResponseError.message - as the Eclipse plugin does
when the structured payload is absent - told the user nothing, prompting
logout/reinstall cycles for an account quota.

Name the cause in the message while keeping the attempt count for support.

(cherry picked from commit 4fa62f70399f367668c7b528c1af7e917eb06974)

* chore(chat-client): use Mynah UI 4.40.5 beta (#2955)

(cherry picked from commit d8759bb55136f2503a595d352444be39e72d2194)

* fix(amazonq): mark oversized file context as truncated instead of cutting silently (#2871)

File content added as chat context is capped at workspaceChunkMaxSize with a plain substring, so the model receives only the beginning of large files and has no way to know the file continues. It then reports the wrong file size (e.g. "this file only has 251 lines") instead of reading the rest with its tools.

Add truncateContextContent() which appends an explicit truncation marker (including the real character count) while keeping the result within the same size budget, and use it for innerContext in AdditionalContextProvider. Add unit tests.

(cherry picked from commit 2fa273711cf60a3f76235910bfbaebbd4facf465)

* chore(chat-client): bump mynah-ui to 4.40.5

(cherry picked from commit 5be2d6b4f7dbc20d30ece7fe595634391a7dcdde)

---------

Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>

* feat: AWS Transform: IAM (SigV4) authentication in the language server (#2948)

* feat(amazonq): add IAM (SigV4) auth path for AWS Transform FES calls

Parallel to the existing IdC bearer flow: the IDE pushes IAM credentials via
aws/credentials/iam/update and the tenant URL via aws.atx configuration, and
the language server SigV4-signs FES calls when both are present. Bearer path
unchanged.

- AtxTokenServiceManager: getAuthType(), getIamCredentials() (reads the main
  credentials provider's iam slot), IAM-aware hasValidCredentials(), and an
  applicationUrl setting on the aws.atx section.
- atxTransformHandler: addAuthToCommand() SigV4-signs on the IAM path (service
  transform, region from the tenant URL), headers set case-insensitively
  before signing; verifySession() validates IAM credentials on that path;
  not-signed-in fails before any network call. Secret-safe logging.
- Declare @smithy/signature-v4 and @aws-crypto/sha256-js.
- Tests for auth-type/credential/tenant-URL handling and bearer vs IAM vs
  not-signed-in signing.

* feat(amazonq): clear AWS Transform IAM session on IAM credentials delete

On aws/credentials/iam/delete the runtime clears the IAM credentials slot. The
AWS Transform service manager now also clears the IAM tenant URL and resets its
cached FES client, so no IAM session state is kept after sign-out. Uses the
existing runtime notification; no new LSP method.

- amazonQServer forwards IAM credential deletions to AtxTokenServiceManager.
  Bearer deletions keep their existing handling.
- AtxTokenServiceManager handles IAM deletion. The bearer token is untouched.
- Tests for the cleared state, bearer token unaffected, and IAM-only forwarding.

* feat(amazonq): honor client declared AWS Transform auth mode

Add an aws.atx authType setting (iam or bearer) that the client sends with
each sign-in. When declared, getAuthType reports only that mode, so stale
credentials of the other type are never used to call FES. Switching to
bearer clears the IAM tenant URL and resets the cached FES client through
the same path as the IAM credentials delete. The IAM credentials delete
also resets a declared iam mode.

Without a declared mode the auth type is derived from the credentials
present, as before.

* feat(amazonq): add AWS Transform session validation command

Add aws/atxTransform/validateSession, a read-only check the client runs
before reporting IAM sign-in as connected. It makes one ListWorkspaces call
with maxResults 1 through the same signing, tenant URL and permission path
as real requests, and never goes through the create path.
listOrCreateWorkspace is unchanged.

Failures are classified where the typed SDK error is available, into
ExpiredCredentials, MissingPermission, TenantNotFound, NetworkOrService or
Other. The response carries only the reason, error name and HTTP status,
and only those are logged, never the error message or credential values.

FES returns AccessDeniedException for expired or invalid security tokens
and for signature mismatches, so AccessDeniedException is checked against
reason INVALID_SESSION and two fixed AWS phrase lists, kept together in
atxSessionValidation.ts. A signature mismatch is reported as Other.

* fix(amazonq): classify SigV4 INVALID_SESSION errors instead of reporting expired

FES returns AccessDeniedException with reason INVALID_SESSION on the SigV4
path for several cases that are not expired credentials, so session
validation showed an expired message for all of them.

- New reasons, matched on the FES message (lowercase phrase match):
  - IamAuthNotEnabled: SigV4ProfileResolutionHandler, SigV4 access is not
    enabled for this profile (IAM authentication off in the Transform
    profile settings).
  - IamAuthNotEnabledForAccount: SigV4FeatureFlagHandler, SigV4 access is
    not enabled for account.
  - TenantMismatch: SigV4ProfileResolutionHandler, credentials do not match
    the provided tenant.
- Expired and invalid security token phrases still map to
  ExpiredCredentials, and signature mismatch still maps to Other.
- INVALID_SESSION with an unrecognized message now maps to Other instead of
  ExpiredCredentials. If FES rewords a message, it falls back to Other.
- The FES message is never logged or returned (the account message contains
  the account ID); only the reason, error code and status are.

Tests for each reason, the fallbacks, and that no message text or account ID
leaks into the result or the log.

* fix(amazonq): return error code and status for failed AWS Transform commands

Failed AWS Transform commands returned only an error flag and message, so
the IDE could not tell AccessDenied apart from other failures and kept
polling. Add errorCode and statusCode to the error result, and return the
GetJob error code and status with JOB_NOT_FOUND. The error message is
unchanged and never parsed by the client.

* fix(amazonq): validate the AWS Transform tenant URL for IAM (SigV4) auth

The aws.atx application URL is kept only when it is an https AWS Transform URL in a
region with an FES endpoint, reduced to its origin. On IAM, the region comes only
from a valid URL (no default region fallback), and requests are not signed without
one. The IdC path is unchanged.

* chore(release): release packages from branch main (#2981)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.84.0 (#2989)

Co-authored-by: aws-toolkit-automation <>

* fix(lsp-yaml): load the schema once instead of on every request (#3017)

* fix(lsp-yaml): load the schema once instead of on every request

YamlLanguageService called configure() before every hover, completion,
validation and format request. configure() clears the schema cache, so
each request downloaded and parsed the 17.5 MB SAM schema again. This
made the CloudFormation completion integ test exceed its 8s timeout on
Windows runners.

Configure the service once in the constructor with the same settings
and a '*' file match, so the schema is fetched and resolved once per
server process.

* fix(lsp-yaml): reload the schema after a failed load

Loading the schema once means a failed load stayed cached for the life of
the process. Before, the per-request configure() cleared the cache, so the
next request fetched the schema again.

Record when the resolver throws, returns content that is not JSON, or the
default fetch gets a non-OK response, and re-run configure() on the next
request in that case only. A successful load is still fetched once, and
the returned content and diagnostics are unchanged.

* fix: update bundled Node.js to 24.22.2 for CVE-2026-111497 (#3026)

Node.js 24.9.0 is affected by CVE-2026-111497, which is fixed in
Node.js 24.22.1. The 24.9.0 pin was a temporary workaround for a
Node.js release issue that has since been resolved.

* ci: open a pull request when a newer bundled Node.js release is available (#3027)

A daily workflow now opens a draft pull request that updates NODE_SEMVER
when Node.js publishes a newer release on the bundled major line, after
checking the new files against their published checksums.

download-node.sh now verifies the SHA-256 of each file, stops on HTTP
errors, and stops when a platform file is missing from the release.

* chore(release): release packages from branch main (#3022)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.85.0 (#3034)

* fix: address security issues (#3041)

* fix(identity): validate section and setting names when saving profiles

- Accept only the profile and sso-session settings that the store
  loads.
- Require section names that the AWS SDK reads back as the same
  section.
- Write each section header and setting on a single line.

* fix(identity): preserve shared config file modes when saving

- Create the rewritten file with the mode of the file it replaces, or
  0600 for a new file.
- Keep credentials files owner-only, including the backup.
- Create a new shared config directory with 0700.

* fix(amazonq): limit diff and similarity work for large edit suggestions

- Compute the accepted-edit character diff with two rows instead of a
  full table, skip the common prefix and suffix, and approximate it
  when the table would exceed 1,000,000 cells.
- Compare rejected edits by edit distance only up to 2,000 characters.
  Longer edits match only an identical rejection, which is unchanged
  for the default threshold of 1.0.

* fix(amazonq): keep workspace rule resources inside the workspace

- Load absolute resource paths only from the global agent config.
- Load workspace rule files only from inside the workspace folder.
- Log each resource that is skipped.

* fix(amazonq): reserve built-in tool names for MCP tool registration (#2982)

* fix(amazonq): reserve built-in tool names for MCP tool registration

MCP tool names came from a server's tools/list and were used in their
bare form whenever the name was not already in the collision set. That
set was not seeded with the built-in tool names, so a server could
register under one and replace the built-in entry.

createNamespacedToolName now takes a reservedNames set, never returns a
reserved name from any naming branch, and discards a persisted name
mapping that points at one. Both call sites seed the set from
agent.getBuiltInToolNames() so the reservation tracks tool registration.
MCP cleanup paths skip built-in names.

* fix(amazonq): dispatch tool confirmation on the registered tool name

processToolConfirmation resolved its switch subject as toolType ||
toolUse.name. The MCP branch passes the server's original tool name as
toolType for display, so a tool advertised as fsRead selected the
built-in fsRead card, which reads input.paths and threw "Paths array
cannot be empty." before any approval card was shown. The same name
also drove the isStandardTool classification and the executeBash body
check.

Dispatch and classification now use toolUse.name, the registered name,
which is namespaced for MCP tools. toolType stays display-only.

* fix(amazonq): guard optional tool name in confirmation classification

ToolUse.name is string | undefined, so the isStandardTool check needs
the undefined guard that the previous expression carried. Restores it
on the dispatch name. An undefined name classifies as non-built-in.

* test(amazonq): cover reserved built-in names in MCP tool naming

Adds cases for every built-in name, two servers advertising the same
built-in name, re-registration reusing the namespaced name, truncation
of a long server name, the numeric-suffix fallback skipping a reserved
candidate, and the default empty reserved set keeping prior behavior.

* test(amazonq): cover sanitized names that collapse onto a built-in name

sanitizeName strips disallowed characters, so an advertised name such as
"fs Read" becomes "fsRead". The reserved check runs on the sanitized
form; this pins that behavior.

* fix(amazonq): key remaining tool-name branches on the registered name

getUpdateToolConfirmResult resolved its subject as originalToolName,
which is the server's original tool name on the MCP approval path. A
tool advertised as executeBash therefore rendered the shell card, which
reads input.command, and one advertised as a filesystem tool selected
those cases. Dispatch now uses toolUse.name; originalToolName and
toolType remain display-only. The built-in path already passes
toolUse.name, so built-in rendering is unchanged.

getMessageIdForToolUse no longer branches on toolType, so a server
cannot steer a card to the built-in executeBash message id. The
parameter is now unused and is removed.

The Built-in tool list in mcpEventHandler selected tools by excluding
raw MCP tool names, which hid a built-in whose name an MCP server also
advertises. It now selects by getBuiltInToolNames().

* fix(amazonq): keep unclassified tools in the Built-in list

The previous commit selected the Built-in list purely by
getBuiltInToolNames(), which dropped the three LSP tools that register
without a ToolClassification and were previously listed.

The filter is now additive: a built-in is always listed, and any other
tool is listed unless it matches an MCP tool name. The MCP name set also
includes the namespaced names tools are actually registered under, so a
colliding MCP tool is excluded rather than appearing alongside the
built-in it shadowed.

* test(amazonq): cover MCP tools whose name matches a built-in tool

Drives processToolUses with an MCP tool registered as probe___fsRead
whose server-advertised name is fsRead, and asserts the server's name
never selects built-in behavior: the confirmation card is the MCP
summary card rather than the built-in read card, the built-in path
validation error does not surface, the MCP permission is consulted
under the server and original tool name, runTool receives the
registered name, and the accepted-result card is the MCP card.

A second case registers probe___executeBash and asserts no card renders
as the shell command card and the confirmation uses the plain
toolUseId rather than the shell tool's message id.

* fix(amazonq): reserve statically dispatched tool names

* fix(amazonq): require workspace containment before opening chat card files (#2906)

* fix(amazonq): require workspace containment before opening chat card files

onFileClicked passed card paths to showDocument with no containment
check. The fsRead branch opened params.filePath directly, the default
branch opened params.fullPath directly, and resolveAbsolutePath joined a
relative filePath onto the workspace root, so a traversing relative path
escaped as well. Card paths originate in model tool results and service
findings, so a manipulated response plus one click opened any readable
file and fed it to completion context.

All three open paths now go through openIfAllowed, which canonicalizes
the path and reuses requiresPathAcceptance: a file opens only when it is
inside a workspace folder or the user already approved it for the card's
tool in this session. The user prompts directory is allowed for
.prompt.md files, which resolveAbsolutePath deliberately resolves there.
Refused clicks are logged and otherwise ignored.

Tests cover an inside file, an outside fullPath, an escaping relative
path, an fsRead card for an unapproved and an approved outside path, an
fsWrite approval not unlocking an fsRead card, a prompt file in the
prompts directory, and a non-prompt file in that directory.

* fix(amazonq): prompt before opening an out-of-workspace chat card file

The previous commit refused such opens outright and only logged. A card
can legitimately point outside the workspace, for example a findings
path the user wants to inspect, so the open is now gated by a warning
dialog instead of dropped.

openIfAllowed shows a showMessageRequest warning with Open and Cancel
when requiresPathAcceptance requires acceptance. The message leads with
the specific reason the check returned, such as the sensitive-file
warning, and names the canonical path. Choosing Open records the path
for the card's tool in the session's approved paths, so a repeat click
or a later tool use on the same path does not prompt again. Cancel or
dismissal aborts the open. In-workspace, already-approved, and prompt
directory paths open without a dialog as before.

MessageType and MessageActionItem are imported from the protocol module,
which already supplied MessageType to this file; a second import from
server-interface produced a duplicate identifier.

Tests cover the dialog contents and action order, Open opening the file,
Cancel and dismissal refusing, the choice being remembered across
clicks, the sensitive-path reason surfacing in the dialog, and existing
approvals suppressing the dialog.

* fix(amazonq): normalize Windows paths in approval lookup

Match single backslash separators consistently with session approval storage.
Normalize Windows paths before sensitive-location pattern checks.
Add session round-trip tests for drive and UNC paths and use native separators
in the sensitive-path fixture.

* fix(amazonq): open file links from chat answers in the editor (#3016)

* fix(amazonq): open file links from chat answers in the editor

* fix(amazonq): handle Windows file links

* fix(amazonq): detect sensitive Windows paths

* fix(amazonq): separate file-open consent

* fix(amazonq): refine chat file-link handling

- Keep encoded '#' and '?' in file names and accept 'file.ts:10' line suffixes.
- Tell the user when a link is not opened or a linked file is not found.
- Keep link-click telemetry for links handled inside chat.
- Retain an fsRead Open choice only for paths an fsRead call requested, and say so in the dialog.

* fix(amazonq): bound not-found message and match home-relative fsRead paths

* fix(amazonq): retain fsRead Open choice only for regular files

* fix(amazonq): check regular files with node fs for fsRead retention

* test(amazonq): cover forward-slash and ~user fsRead inputs

* fix(amazonq): require exact approval for sensitive paths

- Credential and system paths need their own approval, not a parent
  directory's. This also applies to the executeBash working directory.
- A file with more than one hard link needs approval in fsRead, fsWrite,
  fsReplace and grepSearch, and as an executeBash file argument. An
  approval covers such a file only while it is the same file with no
  more names.
- Keep executeBash file checks for approved paths.
- Record an approved path after the tool succeeds, and for executeBash
  only when the command exits normally. An executeBash approval allows
  the working directory only for an out-of-workspace prompt of a
  read-only command, and never the home folder, a folder above it, or a
  hidden or settings folder.

* fix(amazonq): show the full command in shell command cards

- Use a code block fence that is longer than any run of backticks in the
  command, in the approval card and the other shell command cards.

* fix(amazonq): ask before modifying workspace configuration files

- Ask before fsWrite or fsReplace modifies files in .amazonq, .vscode,
  or .git folders in the workspace, including linked folders, the
  AmazonQ.md rules file, or the global Amazon Q configuration when the
  workspace includes it.
- Memory bank generation can still write its own files, only in the
  request that asked for the memory bank.

* test: run every unit test file to completion

* feat(amazonq): start local MCP servers only in trusted workspace folders (#3019)

* fix(amazonq): explain why local MCP servers wait for workspace trust (#3039)

List servers held by the workspace trust check under "Waiting for trust"
with what starts them, instead of under Disabled, and keep such a server
when it is saved.

* fix(amazonq): stricter checks for chat file links and configuration files (#3042)

fix(amazonq): stricter checks for chat file links and configuration files

---------

Co-authored-by: hezelin <hezelin@amazon.com>

* chore(release): release packages from branch main (#3045)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.86.0 (#3050)

Co-authored-by: aws-toolkit-automation <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: XiaowenMaoA <107279155+XiaowenMaoA@users.noreply.github.com>
Co-authored-by: Dung Dong <dungdong@amazon.com>
Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
Co-authored-by: tomar-gunjan <tomgun@amazon.com>
Co-authored-by: Boyu <bywang@amazon.com>
Co-authored-by: invictus <149003065+ashishrp-aws@users.noreply.github.com>
Co-authored-by: hezelin <hezelin@amazon.com>

* docs(amazonq): record the launch request's build configuration in the ATX models (#3072)

AtxAppLaunchApp.configuration and AtxAppLaunchResult.configuration, mirroring
the C# classes in the VS extension. The IDE reads request.json from the
downloaded artifact itself, so these interfaces are the contract's documentation
rather than something the language server parses, and no forwarding code
changes: the field reaches the IDE already.

The IDE side (build and start in the requested configuration, matched against
the ones the project declares) is in the toolkit's companion change.

* chore: merge main into feature/ITGen-RIV (Node 24.22.3, IAM auth follow-ups) (#3073)

* chore(release): release packages from branch main (#2959)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.83.0 (#2973)

Co-authored-by: aws-toolkit-automation <>

* chore: merge feature/OHI fixes to main (#2978)

* fix: stop pinned context leaking to new chat windows (#2786)

addPinnedContext aliased the shared module-level DEFAULT_PINNED_CONTEXT
array and then mutated it with unshift/push. Pinning context in one tab
therefore polluted the default, so every new chat window inherited that
pinned item and it could not be removed. getPinnedContext also returned
the shared default array directly.

Copy the default array in both places so pinning in a tab no longer
mutates the shared default. Adds a regression test.

(cherry picked from commit e31138996f5720cf2b7244afdba05f897026ed3e)

* fix(amazonq): stop memory bank analysis from blocking the language server (#2927)

The memory bank TF-IDF step stored dense, vocabulary-wide vectors and built a
union Set of both vectors for every one of the N^2 file pairs. On a large
workspace this ran for over a minute synchronously on the language server
event loop, so other requests, such as a new chat tab's pinned context and
rules, were not handled until it finished.

- Build sparse TF-IDF vectors with precomputed norms, count document
  frequency once per document, and compute only the upper triangle of the
  cosine matrix. Results are unchanged.
- Yield to the event loop periodically during the analysis.
- Fix the "20KB" size filter, which compared line counts instead of
  characters and let multi-megabyte single-line files through.

* refactor(amazonq): clarify cosine similarity variable names

(cherry picked from commit c812bea34018486f3e7026da74fc480682d50591)

* fix(amazonq): match recorded approvals for Windows paths(#2939)

isPathApproved normalized separators with a pattern that only matched
doubled backslashes, so Windows paths never matched approvals recorded
for a parent folder or for the same path in a different separator form.
Normalize separators and compare paths consistently, and add tests for
multi-path reads and Windows-style paths.

(cherry picked from commit a4941a4f5cab5f1f40d03ce8eb05f7ca280eba57)

* fix(amazonq): restore MCP permissions for legacy and duplicate servers (#2936)

MCP 'Always Allow' reverted to 'Ask' after every restart or MCP refresh for
servers declared in a legacy mcp.json. updateServerPermission writes the
'@server/tool' entries into agents/default.json but deliberately omits the
server definition, while loadAgentConfig only re-applied '@'-prefixed entries
while iterating the same file's mcpServers block. Legacy servers have no such
entry, so their permissions were dropped on every load; duplicate
workspace/global servers hit the same gap because they 'continue' before the
permission pass.

Stash server-scoped permission entries during the per-file pass and drain them
for every server that actually loaded, once agent, legacy and registry servers
are all known.

(cherry picked from commit 1dd370212771dfe33a36d352059063fa61ffa4ef)

* fix(amazonq): honour configured MCP tool call timeout (#2935)

* fix(amazonq): pass configured MCP timeout to the SDK request options

MCP tool calls were capped at the SDK's 60s default request timeout because
McpManager.callTool never passed RequestOptions to client.callTool. A
configured timeout above 60s only armed the outer Promise.race, which can
shorten but never extend the deadline, so the SDK cancelled first with
'MCP error -32001: Request timed out'. timeout: 0 ('no timeout') was capped
at 60s for the same reason.

Resolve the effective timeout once and hand it to the SDK, mapping 0 to the
largest value setTimeout honours and falling back to the 60s default (with a
warning) for negative, non-finite or over-large values.

* test(amazonq): type MCP warning logger arguments

(cherry picked from commit 92ca07299c7453601498bb70d459236b6f7707bf)

* fix(amazonq): say so when a request fails on a usage limit (#2938)

A usage-limit condition surfaced as the bare 'Request failed after 3
attempts', which is indistinguishable from generic retry exhaustion. The
actionable text ('Monthly limit reached') exists only in ResponseError.data,
so clients that surface ResponseError.message - as the Eclipse plugin does
when the structured payload is absent - told the user nothing, prompting
logout/reinstall cycles for an account quota.

Name the cause in the message while keeping the attempt count for support.

(cherry picked from commit 4fa62f70399f367668c7b528c1af7e917eb06974)

* chore(chat-client): use Mynah UI 4.40.5 beta (#2955)

(cherry picked from commit d8759bb55136f2503a595d352444be39e72…
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…he whole file is on disk (#3077)

* feat(amazonq): send generate_integration_tests and browser in ATX CreateJob objective (#2962)

Forward the customer's "Generate and run integration tests on this machine"
choice and the detected local browser from the StartTransformRequest to the
ATX job objective.

- StartTransformRequest: optional GenerateIntegrationTests and Browser {Type, Version}
- createJob: writes generate_integration_tests only when it is a real boolean
  (an explicit false is a decline; absent keeps legacy behavior), and
  browser {type, version} only when well-formed
- Objective key names live in ATX_OBJECTIVE_GENERATE_INTEGRATION_TESTS_KEY /
  ATX_OBJECTIVE_BROWSER_KEY; the integration-test key is pending the Transform
  agent's C1 confirmation
- Unit tests for createJob objective and startTransform forwarding

* feat(amazonq): add ITGen test-run and app-launch models (contract v0 draft) (#2967)

* feat(amazonq): add ITGen test-run request and summary models (contract v0 draft)

TypeScript mirror of the VS extension's AtxTestRunRequest / AtxTestRunSummary
for the ITGen integration-test HITL payloads (ITGen–IDE contract v0, schema
1.0). Not wired into any handler yet.

- AtxTestRunRequest: top-level artifactId (repo artifact holding the generated
  test projects, re-downloaded per request) and localFolder; side decides
  where the app starts (original: upload copy, transformed: solution), so no
  source code is downloaded. ATX_TEST_RUN_BASE_URL_ENV = AB_BASE_URL is set by
  the IDE on the port it picks.
- AtxTestRunSummary: status, appUrl, startedAt/finishedAt, durationSeconds,
  counts, failingTests.
- isSupportedAtxTestRunSchemaVersion: accepts the same major version as
  ATX_TEST_RUN_SCHEMA_VERSION (1.x); rejects other majors and malformed values.
- Unit tests with a real Bob's Used Bookstore run reshaped to the contract.

* feat(amazonq): add ITGen app-launch request and result models (contract v0 draft)

TypeScript mirror of the VS extension's AtxAppLaunchRequest / AtxAppLaunchResult
for the integ-app-launch HITL (transformed-code run contract, Taskei P541522260,
merged into P541522201).

- AtxTestRunApp extracted so the test-run and app-launch requests share it.
- AtxAppLaunchRequest: side, project, attempt, app (proposal; contract v0 §6
  defines only the result). Like LBV's rounds, the number of attempts is the
  agent's decision, so there's no limit field.
- AtxAppLaunchResult: status STARTED | APP_NOT_STARTED, appUrl,
  healthCheck {path, httpStatus}, error, logFile, durationSeconds.
- Unit tests with Bob's Used Bookstore's real first launch.

* refactor(amazonq): trim ITGen test-run and app-launch requests to the fields the IDE needs

Mirror of the VS extension change (contract v0 review, 10/23):

- AtxTestRunRequest: schemaVersion, runId, side, project, artifactId,
  tests.projectPath, limits.projectTimeoutSeconds. Dropped round, localFolder,
  app, env and limits.maxResultZipMB.
- AtxAppLaunchRequest: app is now AtxAppLaunchApp {webProject,
  healthCheckPaths?, startTimeoutSeconds?}; dropped host.

* feat(amazonq): ITGen test HITL handlers, any-depth diff apply, completeHitlWithTestResults (behind ATX_ITGEN_ENABLED) (#2976)

* feat(amazonq): apply ITGen step diffs at any plan depth behind ATX_ITGEN_ENABLED

With integration tests on, the agent nests LBV under local-verification
(CR-315347405), so LBV error-fix rounds move to depth 3 and are never
applied, while the nested LBV step (depth 2, no diff) is reported as a
failed apply on every poll.

Behind the new ATX_ITGEN_ENABLED flag (stand-in for the row 18 feature
flag), completed steps are selected by having a step-tagged
CUSTOMER_OUTPUT artifact rather than by depth: one paginated job-wide
ListArtifacts call, only when a SUCCEEDED step still needs a download.
Steps without an artifact are skipped, not failed; steps apply in tree
post-order. With the flag off, the depth-2 behavior is unchanged.

* feat(amazonq): add ITGen test HITL handlers and completeHitlWithTestResults behind ATX_ITGEN_ENABLED

Language-server side of the ITGen-IDE contract v0 (sections 3-6), all
gated on ATX_ITGEN_ENABLED; with the flag off every path is unchanged.

- HITL selection: integ-app-launch, then integ-test-run, after LBV and
  missing-packages and before *-checkpoint, at all three selection sites.
  integ-* HITLs are returned with their StepId on the EXECUTING, PLANNING
  and AWAITING_HUMAN_INPUT paths, never treated as a plan-review ZIP.
- getTransformInfo returns OpenHitls[] (TaskId, Tag, StepId, expiry),
  built from the ListHitls the poll already made. For integ-* HITLs the
  agent's request is saved once per task to
  artifactWorkspace/<job>/hitl/<taskId>/request.json and rejected
  (RequestError) when the schemaVersion major isn't 1. For integ-test-run
  the repo artifact with the generated tests is downloaded again for every
  task into itgen/<runId>/tests (TestsPath), since the agent rewrites it
  under the same id. Agent-supplied ids used as folder names are checked.
- New aws/atxTransform/completeHitlWithTestResults: checks the result ZIP
  holds summary.json (test run) or launch-result.json (app launch) with a
  supported schemaVersion, uploads it as HITL_FROM_USER, completes the
  upload and submits the task by id (SubmitCriticalHitlTask).

* feat(amazonq): align ITGen test HITLs with contract v0 schema 1.1

Follows the 10/26 contract update (interactive app launch):

- completeHitlWithTestResults adds the customer's changed files to every
  transformed-side result ZIP (launch and test run) as
  workspace/metadata.json + workspace/<relative path>, with the same scan
  and metadata as updateWorkspace (tracked files modified since job
  start). The IDE's ZIP is left as it is; a copy is uploaded. Original
  side results are uploaded unchanged.
- AtxAppLaunchResult gains optional launchedBy ('ide' | 'customer').
- NOT_LOCALHOST is removed from AtxTestRunStatus (published URLs are
  allowed on the original side).
- ATX_TEST_RUN_SCHEMA_VERSION is 1.1 (1.0 payloads are still accepted).
- The side comment now says the original runs from artifactWorkspace/before/.

* feat(amazonq): remove earlier ITGen runs' tests and validate tests.projectPath (#2988)

* feat(amazonq): keep only the ITGen test project per run and drop earlier runs' tests

The integ-test-run tests artifact is the repo artifact, which can hold the
whole repo. Extract it to a staging folder and keep only the folder of
tests.projectPath (falling back to the whole artifact, with a warning, when
that folder isn't in it). Refuse a rooted or climbing tests.projectPath.
Once a run's tests are in place, remove the tests of earlier runs of the
same side and project; their run folders (with the result ZIPs) stay.

* fix(amazonq): keep the whole ITGen tests artifact so project references resolve

A generated test project can reference other projects in the artifact (for
example a common library from the source repo) and rely on its root build
files (Directory.Build.props, Directory.Packages.props, nuget.config), so
filtering to the test project's folder could break its build. Extract the
whole artifact in its own layout again; earlier runs' tests are still removed,
so a job keeps one copy per project. Warn when tests.projectPath isn't in the
artifact, and keep refusing a rooted or climbing tests.projectPath.

* fix(amazonq): guard ITGen test cleanup against overlapping downloads

Address review on #2988:
- Overlapping polls for the same task now share one download, and only the
  newest run started for a side and project collects earlier runs, so a late
  duplicate or stale download can't delete the current run's tests.
- No marker and no cleanup when the request has no side or project.
- Reusing tests downloaded before tests.project existed backfills the marker.
- The comment and test fixture describe independent test projects (contract
  decision 16), not tests that reference application source.

* feat(amazonq): download a beamed repo's original code to artifactWork… (#2987)

* feat(amazonq): download a beamed repo's original code to artifactWorkspace/before (ITGen)

Adds aws/atxTransform/downloadOriginalCode and OriginalArtifactId on the beamed-repo
record, so the IDE can fetch a beamed repo's pre-transformation source by its
codeArtifactId. It extracts into artifactWorkspace/before, the folder the IDE copies a
local job's original to and the ITGen coordinator reads from. One copy per solution,
tagged with a job marker; stub Directory.Build.*/Directory.Packages.props stop MSBuild
importing the transformed solution's files. Staged extract + rename, so a failed
download never looks complete.

* fix(amazonq): downloadOriginalCode rejects only real '..' segments (ITGen)

A folder name like 'Foo..Bar' in the solution path was rejected as traversal.

* fix(amazonq): make the beamed original download safe to reuse, replace and repeat (ITGen)

From the Code Review Sage review of #2987:
- The marker records the job AND the original-code artifact; a copy is reused only when
  both match (a web job has one original per repo, and an original can be re-saved). An
  older plain-text marker is treated as no match.
- Replacing a copy no longer deletes it in place: the old marker goes first, the old copy
  is moved aside, the new one is renamed in, and the old one is deleted best-effort. A
  copy that is only partly replaced is never reused; if the new copy can't be moved in,
  the old one is put back without its marker.
- Calls for the same solution are queued and each extracts into its own staging folder,
  so two Loads can't corrupt each other; a queued duplicate reuses the finished copy.
  Leftover staging/aside folders are cleaned up on the next call.
- The job id is checked with the shared isSafePathSegment; the comment no longer claims
  it reaches a path.

* fix(amazonq): gate the original-code download on ATX_ITGEN_ENABLED, tidy its file handling

- downloadOriginalCode refuses unless ATX_ITGEN_ENABLED is on, like completeHitlWithTestResults
- one isSafeAbsolutePath check ('..' segments only) for beam and original-code folders
- clear leftovers before the reuse check; match only before.partial-* / before.old-*
- async rename/rm in the swap and cleanup

* feat(amazonq): send ITGen generate_ui_tests and generate_api_tests in ATX CreateJob objective (#3020)

* feat(amazonq): send ITGen generate_ui_tests and generate_api_tests in ATX CreateJob objective

The IDE start dialog now has a Verification checkbox with three
sub-options: Generate unit tests, Generate UI tests and Generate API
tests (ITGen-IDE contract v0, section 1). Forward the two new choices
from the StartTransformRequest to the ATX job objective.

- StartTransformRequest: optional GenerateUITests and GenerateApiTests
- startTransform forwards them to createJob
- createJob writes generate_ui_tests / generate_api_tests only when they
  are real booleans (an explicit false is a decline; absent, as from
  older IDEs, keeps today's objective)
- generate_integration_tests and browser are unchanged: the IDE sends
  integration = UI || API and only sends the browser for UI tests
- Unit tests for the objective keys and startTransform forwarding

* fix(amazonq): name the ITGen start-dialog group Validation in comments

Review follow-up (#3020.1): two new comments called the group "Verification".
The IDE (toolkit #2998) and the contract call it "Validation".

* fix(amazonq): only send ITGen keys in the CreateJob objective when ITGen is on

createJob wrote generate_integration_tests, generate_ui_tests,
generate_api_tests and browser into the ATX job objective whether or not
ATX_ITGEN_ENABLED was on, while the other ITGen paths in the handler
check isItGenEnabled(). Gate all four behind isItGenEnabled() so a
client that sends them can't change job objectives where ITGen is off.

generate_unit_tests stays ungated. It is the separate unit-test
generation choice, shipped on main before ITGen, and is not
part of ITGen.

With ITGen on, the keys are forwarded as before, with the same
boolean-only rule. Tests cover both states, including explicit false
choices and a flag value other than exactly "true".

Refs: #2857

---------

Co-authored-by: David Topchyan <davetop@amazon.com>

* feat(amazonq): generate_integration_tests is the only ITGen key and gate (remove UI/API keys and ATX_ITGEN_ENABLED) (#3024)

* feat(amazonq): make generate_integration_tests the only ITGen objective key

The team agreed (11/02) that generate_integration_tests is the only ITGen
switch in the ATX job objective; the Transform agent ignores
generate_ui_tests and generate_api_tests, and the IDE start dialog keeps one
integration-tests checkbox. Remove the two keys added in #3020: the
StartTransformRequest fields, their startTransform forwarding, and the
createJob writes. generate_integration_tests and browser are unchanged and
still gated on ATX_ITGEN_ENABLED.

* feat(amazonq): gate ITGen on the job's generate_integration_tests instead of ATX_ITGEN_ENABLED

Remove the ATX_ITGEN_ENABLED environment variable. The LS now runs its ITGen
code only for jobs whose objective has generate_integration_tests: true:
ITGen HITL selection and OpenHitls, completeHitlWithTestResults, diffs at any
depth, and downloadOriginalCode. Every other job behaves as before ITGen.

- createJob always writes generate_integration_tests when the client sends a
  real boolean, and browser only with integration tests. It remembers the
  job's flag, so no extra call is needed for jobs this LS created.
- For other jobs (resume, job history, beam) the flag is read once from the
  job objective: getTransformInfo asks GetJob for the objective until the job
  is known, and isItGenJob does the same outside a poll. A failed GetJob isn't
  cached.

* refactor(amazonq): move the ITGen job gate to its own module and bound it

- ItGenJobGate (itgenJobGate.ts) owns the per-job generate_integration_tests
  flag: createJob records it, other jobs are read once from their objective,
  and a failed read isn't remembered.
- The map is capped at 200 jobs (oldest dropped) and a job is forgotten in
  clearJobCache, on terminal statuses and stop.
- No per-poll shared flag: each check looks up its own job id, so overlapping
  getTransformInfo calls for different jobs can't read each other's value.

* fix(amazonq): keep each ITGen project's test runs in its own folder (#3031)

* fix(amazonq): keep each ITGen project's test runs in its own folder

The agent can use the same run ids (r1, r2, p1) for every project of a solution, so a
later project's run unpacked its tests over an earlier project's. Test-run tests now go
to artifactWorkspace/<job>/itgen/<project>/<runId>/tests (itgen/<runId>/tests when the
request has no project), and only the project's own earlier runs are cleaned up. A
project that isn't a single folder name is refused.

* fix(amazonq): return the plan while an executing job waits on chat

handleAwaitingHumanInput took a job for one still being planned unless its first
top-level step had sub-steps. When that step is a leaf (for example "Assess Solution"),
an executing job waiting on a chat question went down the planning path, which returns
no plan, so the IDE kept showing a stale plan. A plan now exists once any top-level
step has sub-steps.

* Revert "fix(amazonq): return the plan while an executing job waits on chat"

This reverts commit 4e2e6edddc7cb0d0519bb00ef70423df80140e91.

* fix(amazonq): give any ITGen project name a safe folder, and reword internal references

- An empty project is no project. A project name that isn't a plain folder name (a
  space, parentheses, a leading underscore, a Windows device name, a trailing dot) gets a
  safe folder with a hash of the name, so its test run still works instead of failing.
- Comments in atxTransformHandler.ts describe past issues without internal ticket ids or
  customer names.

* fix(amazonq): keep returning the plan while a job waits on chat or a step review (ITGen) (#3021)

* fix(amazonq): keep returning the plan while a job waits on chat with no HITL open (ITGen)

handleAwaitingHumanInput chose the planning phase whenever the plan's first top-level
step had no sub-steps. When a job is AWAITING_HUMAN_INPUT with no HITL open, the agent
is waiting on a chat answer (for example "anything else, or mark the job complete?" at
the end of the job). The planning branch returns no TransformationPlan, so the IDE
stopped seeing step statuses: with ITGen it never saw Local Verification finish, and
the apps it had launched kept running while the job waited on chat.

With no HITL open and a plan that has steps, take the execution path, which returns the
plan. A planning HITL (plan review) carries a tag, so it still takes the planning path.

* fix(amazonq): take the execution path for step reviews, not for a failed HITL lookup (ITGen)

handleAwaitingHumanInput picks the planning or execution phase from the plan's shape (does the
first step have sub-steps?), and the previous commit made an exception for "no HITL open". Two
gaps remained:

- A step review HITL ({stepId}-review) on a plan whose first step has no sub-steps still took
  the planning path, which returns no plan and no StepInformation, so the IDE couldn't show the
  step review. A HITL whose tag is the review tag of a step in the plan now takes the execution
  path, whatever the plan's shape.
- getHitlAgentArtifact returns null both when no HITL is open and when the lookup fails, so a
  failed ListHitls was read as "no HITL open". During plan review that skipped the planning
  path, which looks the HITL up again and so usually recovers in the same poll.
  getHitlAgentArtifact now reports a failed lookup to callers that ask (optional `lookup`
  argument), and the no-HITL exception applies only when ListHitls answered with nothing open.

* test(amazonq): cover the sibling-repo LBV case of "no HITL to surface" (ITGen)

getHitlAgentArtifact also returns null, without setting lookup.failed, when the request is
beam-scoped and the only open HITLs are local-build-verification HITLs outside the scope (a
sibling repo's, on a multi-repo beam job). handleAwaitingHumanInput reads that as "no HITL to
surface" and returns the plan alone, as the EXECUTING and PLANNING branches already do for that
case. Before this PR, a plan whose first step has no sub-steps sent it down the planning path,
whose lookup isn't beam-scoped, so the response carried the sibling's tag without its step id or
the plan.

The behaviour doesn't change. This documents the case in getHitlAgentArtifact's JSDoc and in the
phase comment in handleAwaitingHumanInput, renames noHitlOpen to noHitlToSurface, and adds tests:
- handleAwaitingHumanInput, through the real getHitlAgentArtifact: a beam-scoped request whose
  only open HITL is a sibling's LBV, on a plan whose first step has no sub-steps, gets the plan
  and no HitlTag, HitlTaskId or StepInformation, and ListHitls is called once. Fails against
  feature/ITGen-RIV, where the planning path returns the sibling's tag.
- getHitlAgentArtifact: that case returns null and leaves lookup.failed unset.

* chore(amazonq): remove internal ticket references and a customer name from netTransform (ITGen)

This repo is public. Comments in atxTransformHandler.ts and atxTransformHandler.test.ts cited
internal ticket references and named a customer. Each comment keeps its technical meaning: the
ticket references are dropped, and the customer is now "a customer-reported edit clobber". The
applyChanges test fixture's job id is now 'job-edit-clobber'.

Comments and a test fixture id only; no behaviour change.

---------

Co-authored-by: David Topchyan <davetop@amazon.com>

* feat(amazonq): model the 1.1 testOrder field on the test-run request and summary (#3032)

## Problem

`atxModels.ts` says its ITGen interfaces "match C# AtxTestRunRequest /
AtxTestRunSummary ... in the VS extension", but neither has the
`testOrder` field schema 1.1 sends, and the `AtxTestRunRequest` docblock
still lists only `AB_BASE_URL`, `AB_SIDE` and `AB_RUN_ID` as the
variables the IDE sets.

Nothing breaks today: the agent's `request.json` is downloaded and
handed to the IDE by path, and a TS interface is compile-time only, so
`JSON.parse` keeps `testOrder` whether it's declared or not. But the two
copies of the contract that claim to match each other now differ, so the
next change here that types or validates these payloads would drop a
field the agent relies on.

## Changes

- `AtxTestRunRequest.testOrder?: string` — optional, added in 1.1.
  `pre_run_loop.py` sends it as `default`, `reverse` or
  `shuffle:<seed>`; the agent asks for a second order before it freezes
  a suite, so the IDE sets `AB_TEST_ORDER` from it.
- `AtxTestRunSummary.testOrder?: string` — echoed back.
  `evaluate-pre-run-request.schema.json` says "Write testOrder in
  summary.json when the run used AB_TEST_ORDER", and EVALUATE_PRE_RUN
  tells the two orders of a suite apart by it.
- The `AtxTestRunRequest` docblock now lists `AB_SCREENSHOTS_DIR` and
  `AB_TEST_ORDER` alongside the three it already named.

Types only — no handler reads or writes these fields, and
`completeHitlWithTestResults` is untouched.

## Testing

- New `atxModels.test.ts` case: a request with `testOrder: 'reverse'`
  round-trips through JSON with the field, and one without it serializes
  no `testOrder` key (a 1.0 payload).
- `atxModels.test.ts`: 11 passing.
- `tsc --noEmit` on `aws-lsp-codewhisperer`: clean.

## Related

- aws-toolkit-visual-studio-staging#3011 is the IDE side that reads
  `testOrder` and sets `AB_TEST_ORDER`, `AB_SCREENSHOTS_DIR` and the
  corrected `AB_SIDE`. The two are independent: #3011 works without this
  (the field arrives in `request.json` either way), and this is types
  only.

* feat(amazonq): run ITGen for beamed repos that opt in via the beam-map (#3033)

* feat(amazonq): run ITGen for beamed repos that opt in via the beam-map

- BeamedRepoInfo.GenerateIntegrationTests from the beam-map entry (false on the beam-status path)
- the parent web job counts as ITGen when any beamed repo opts in; a beamed poll reads the
  beam-map in the background, so it survives an LS restart without delaying the poll
- beamed sessions never surface or list a sibling repo's integ-* HITLs
- downloadOriginalCode also writes .atx-job-id (plain job id), which the VS coordinator checks

* fix(amazonq): move the beamed-repo ITGen gate into ItGenJobGate and address review

- ItGenJobGate.isBeamItGenJob: capped like the job map; retries after 60s when the beam-map
  wasn't read (throttle cooldown, scan cut short); background read failures are logged
- scope the planning-phase HITL lookup so a sibling repo's HITL isn't picked there either
- read and write the original-code markers with fs.promises

* feat(amazonq): apply a beamed repo's post-beam step diffs and track the customer's changes (#3037)

* feat(amazonq): apply a beamed repo's post-beam step diffs and track the customer's changes

- a beamed poll applies completed step diffs under the loaded repo's card (not LBV, not pre-beam)
- an opted-in beamed repo gets the customer-changes manifest on its first poll
- integ-* HITLs aren't surfaced while a beamed job's gate is unknown
- a beam-map without an opt-in isn't re-read this session; no worklogs without a solution root
- completeHitlWithTestResults uses the beam-aware gate

* fix(amazonq): address review of the beamed-repo downlink

- the repo card's own step isn't applied, only the steps under it (beamApplyStepIds)
- the step selection and the manifest file walk move to beamRepoFiles.ts, with unit tests
- the manifest is written in the background, once for overlapping polls
- a NuGet packages folder is skipped, a source folder named packages isn't
- tests: a customer edit after Load reaches workspace/, a failed beamed apply marks only that step

* fix(amazonq): track a beamed repo's changes before the first apply

Address the second review of the beamed-repo downlink:
- An apply waits for the pending customer-changes manifest write, so the
  files it adds (for example a generated test project) are tracked.
- Every loaded beamed repo gets the manifest, opted in or not, matching the
  downlink, which applies post-beam steps to each of them.
- One Local Build Verification check (case-insensitive, anywhere in the
  name) for the downlink selection and the handler's LBV lookup.
- The manifest walk skips a folder it can't read instead of failing, and
  logs when it stops at the file cap.

* fix(amazonq): read every ITGen beam-map, and retry one that can't be downloaded (#3040)

* fix(amazonq): retry the ITGen beam-map read when a candidate can't be downloaded

A beam-map that's listed but can't be downloaded (ResourceNotFound until the
web side publishes it to the user-facing bucket) was treated as "not the
beam-map". The scan then counted as complete, and the gate cached "not opted
in" for the session. Now, without a beam-map read, an undownloadable
candidate makes the answer "can't tell", which the gate retries, and the scan
logs a warning naming the artifacts.

* fix(amazonq): back off the beam-map retry and warn once per job

Address the review of the beam-map retry:
- The gate doubles the wait after each read that couldn't tell (60 s up to
  15 min) and starts over once it gets an answer, so beamed sessions whose
  beam-map can't be downloaded don't rescan every minute.
- The scan warns once per job and set of undownloadable candidates.
- Say why a beam-map that was read decides, and test a failed download.

* fix(amazonq): merge every beam-map and cap the reads that can't tell

- The web writes a new beam-map on each beam batch, and ListArtifacts order
  isn't chronological, so keeping the last one listed could drop the repos
  of a later batch. Merge every beam-map; per repo, the newest entry wins.
- After 5 beam-map reads in a row that couldn't tell, treat the job as not
  opted in for the session (logged once), instead of retrying forever: a
  beam-map the service doesn't publish never becomes downloadable.

* fix(amazonq): count only unconfirmed beam-map reads towards the cap

Address the second review of the beam-map retry:
- The beam-map reader tells "unconfirmed" (the scan finished without a
  beam-map while a candidate went unread) from "not read" (throttled, cut
  short, or failed). Only unconfirmed reads back off and count towards the
  cap; a read that didn't happen is retried every 60 s, as before.
- A scan that left candidates past the 25-candidate cap and read no
  beam-map is unconfirmed, not "not opted in".

* fix(amazonq): unconfirmed only for finished scans, and without an opt-in read

Address Xuening's review of the beam-map retry:
- A throttle during the scan makes it unfinished, like the throttle
  cooldown: retried, never counted towards the cap.
- A beam-map that was read but doesn't opt in no longer decides while
  another candidate went unread: that one can be a newer beam-map that opts
  in, so the answer is unconfirmed.
- Only a finished scan with an answer clears the warn-once record, and the
  record is keyed by the sorted artifact ids.

* fix(amazonq): keep directories out of the transform source files manifest (#3052)

* fix(amazonq): keep directories out of the transform source files manifest

A Web Site project's ProjectPath is its folder, so it went into source-files.json as a file: it could show up as a modified file and break the review uplink zip. The manifest now leaves out any path that is a directory, a checkpoint never adds one, and getModifiedFilesSinceCheckpoint never reports one, also from a manifest written before this change.

* fix(amazonq): check only project paths for folders, without a blocking stat

Review on #3052: the folder filter called fs.statSync on every listed path on the startTransform request path. writeSourceFilesManifest is now async and checks only ProjectPath entries, the only ones that can be a folder (a Web Site project), with fs.promises.stat. updateSourceFilesManifest no longer stats; getModifiedFilesSinceCheckpoint, which already stats each path, now counts only files (isFile, as listBeamRepoFiles does), so a folder a checkpoint adds is never reported as modified.

* fix(amazonq): scan beam-map before beam-status in multi-repo beams (#3057)

* fix(amazonq): scan beam-map before beam-status in multi-repo beams

For a multi-repo beam with N repos, ListArtifacts returns N beam-status-*
JSON files plus the actual beam-map. The candidate scan tried them in
arbitrary order within a 15 s budget; with many candidates the beam-map
could fall outside the budget or be throttled, leaving the scan without
the map and causing the IDE to load repos without their original artifact id.

Two changes:
- Skip candidates whose path matches beam-status-*; they never hold the
  beam-map and each wasted candidate narrows the scan budget.
- Sort remaining candidates by path length, shortest first (pathless
  candidates first). The beam-map has no path in ListArtifacts, so it
  is now always tried first.

* fix(amazonq): move BEAM_STATUS_RE inline, use binary sort key, add test

Address code review findings on fix/beam-map-scan-priority:
- Remove function-scope BEAM_STATUS_RE variable; use the literal inline.
- Replace raw path-length sort key with binary pathless/has-path predicate
  so only the pathless vs has-path distinction is expressed, not arbitrary
  ordering within the has-path group.
- Add test: 3 repos, 3 beam-status-* artifacts listed before the pathless
  beam-map — the beam-map is still found first because status files are
  excluded from allCandidates.

* fix(amazonq): treat scan timeout as unconfirmed, add budget test, scan-summary log

Root cause confirmed from box logs (job 401bf8f4): tfm= is empty on ALL lines
across 13 hours of 30-s rescans for the 3-repo beam. The beam-map was never
read because the old code included 8 beam-status-* JSON files as scan candidates;
each download consumed ~2 s of the 15 s budget, leaving none for the pathless
beam-map listed last.

Three additions on top of the beam-status filter + pathless-first sort fix:

1. Scan timeout -> 'unconfirmed' (not undefined)
   readBeamOptIn now returns 'unconfirmed' when discoverBeamedRepos reports
   scanAborted (scanCutShort=true). The gate counts this toward
   beamMaxReadsThatCannotTell (5) and uses exponential back-off (60s, 120s,
   240s, ...), so a job that genuinely cannot serve its beam-map gives up
   after ~16 minutes instead of retrying flat forever. A throttle mid-scan
   stays undefined (not counted) since it is a transient infrastructure hiccup.

2. New test: 8 beam-status files + 1 pathless beam-map, each download "takes"
   2s (sinon fake clock). After the filter fix only 1 candidate remains (the
   beam-map); 1 download is attempted, scan not cut short, repo returned with
   GenerateIntegrationTests=true.

3. Scan-summary INFO log
   One [BEAM-PKG] scan-summary line per discoverBeamedRepos call: result label
   (found-opted-in / unconfirmed / timed-out / throttled-during-scan /
   not-opted-in / no-scan), candidate count, unreadable count, beam-map found,
   repos returned.

* fix(amazonq): throttle mid-scan also counts as unconfirmed (gap from review)

A throttle that fires during the beam-map candidate scan makes the scan just
as incomplete as a budget timeout — the beam-map may not have been reached.
Extend scanAborted to include throttledDuringScan so the gate uses exponential
back-off in both cases rather than retrying flat every 60 s forever.

Update the existing test that expected undefined for the throttle case to
expect 'unconfirmed'.

* fix(amazonq): retry transient CreateArtifactDownloadUrl errors and surface the reason

A Load failed 118 ms after start with "No presigned URL for beam artifact"
and the same Load succeeded minutes later: a transient non-throttle error
on the first CreateArtifactDownloadUrl call returned null with no retry,
and the caller replaced the real reason with a fixed string.

- createArtifactDownloadUrl: also retry transient errors (5xx,
  InternalServerException, ServiceUnavailableException, network errors,
  "unknown error") with the same jittered backoff and 4-attempt cap.
  Not found / access denied / validation / other 4xx still fail at once;
  throttle handling is unchanged. A response without a URL is retried
  once, then returns null.
- Remember the last failure reason per artifact; downloadBeamArtifact and
  downloadOriginalCode now return "Could not get a download URL for the
  ... (<ErrorName>: <message>)" or "The service returned no download URL
  for the ...". URLs are stripped from the message. Other callers still
  get null as before.
- Tests for retry classes, attempt counts and the surfaced error.

* fix(amazonq): address review: explicit opt-in on aborted scan, log unknown download-URL errors, keep transient reason

- readBeamOptIn: a beam-map read before the scan was cut short that opts
  a repo in now returns true (was 'unconfirmed'), and remembers the
  opt-in itself instead of relying on discoverBeamedRepos' side effect.
  discoverBeamedRepos returns optInFound for this.
- classifyDownloadUrlError: any 5xx is transient whatever its name. An
  unrecognized service error is still treated as permanent, but is
  logged once per name ("[BEAM-PKG] CreateArtifactDownloadUrl:
  unrecognized error name=<X> status=<code> - treated as permanent").
- When an attempt fails and the last one returns no URL, the earlier
  reason is kept: "The service returned no download URL for the beam
  artifact (after an earlier error: <Name>: <message>)". The reason is
  cleared on success.
- downloadBeamArtifact returns ErrorCode 'InvalidDestination' for a
  refused destination, so the IDE doesn't have to match the message.
- Tests for each.

* fix(amazonq): retry AccessDenied UnknownError on download URL

CreateArtifactDownloadUrl treated every AccessDeniedException as permanent, so a
denial with no real reason (message "UnknownError") failed the original-code
download on its first attempt, though the same artifact downloaded fine minutes
later. An AccessDeniedException or 403 whose message is empty or "UnknownError"
is now classified as throttling: it gets the same bounded jittered retry (4
attempts) and starts the 90 s beam-map scan cooldown, since a call storm has
also provoked such denials. One with a real reason stays permanent.

* chore: merge main into feature/ITGen-RIV (brings AWS Transform IAM auth) (#3053)

* chore(release): release packages from branch main (#2959)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.83.0 (#2973)

Co-authored-by: aws-toolkit-automation <>

* chore: merge feature/OHI fixes to main (#2978)

* fix: stop pinned context leaking to new chat windows (#2786)

addPinnedContext aliased the shared module-level DEFAULT_PINNED_CONTEXT
array and then mutated it with unshift/push. Pinning context in one tab
therefore polluted the default, so every new chat window inherited that
pinned item and it could not be removed. getPinnedContext also returned
the shared default array directly.

Copy the default array in both places so pinning in a tab no longer
mutates the shared default. Adds a regression test.

(cherry picked from commit e31138996f5720cf2b7244afdba05f897026ed3e)

* fix(amazonq): stop memory bank analysis from blocking the language server (#2927)

The memory bank TF-IDF step stored dense, vocabulary-wide vectors and built a
union Set of both vectors for every one of the N^2 file pairs. On a large
workspace this ran for over a minute synchronously on the language server
event loop, so other requests, such as a new chat tab's pinned context and
rules, were not handled until it finished.

- Build sparse TF-IDF vectors with precomputed norms, count document
  frequency once per document, and compute only the upper triangle of the
  cosine matrix. Results are unchanged.
- Yield to the event loop periodically during the analysis.
- Fix the "20KB" size filter, which compared line counts instead of
  characters and let multi-megabyte single-line files through.

* refactor(amazonq): clarify cosine similarity variable names

(cherry picked from commit c812bea34018486f3e7026da74fc480682d50591)

* fix(amazonq): match recorded approvals for Windows paths(#2939)

isPathApproved normalized separators with a pattern that only matched
doubled backslashes, so Windows paths never matched approvals recorded
for a parent folder or for the same path in a different separator form.
Normalize separators and compare paths consistently, and add tests for
multi-path reads and Windows-style paths.

(cherry picked from commit a4941a4f5cab5f1f40d03ce8eb05f7ca280eba57)

* fix(amazonq): restore MCP permissions for legacy and duplicate servers (#2936)

MCP 'Always Allow' reverted to 'Ask' after every restart or MCP refresh for
servers declared in a legacy mcp.json. updateServerPermission writes the
'@server/tool' entries into agents/default.json but deliberately omits the
server definition, while loadAgentConfig only re-applied '@'-prefixed entries
while iterating the same file's mcpServers block. Legacy servers have no such
entry, so their permissions were dropped on every load; duplicate
workspace/global servers hit the same gap because they 'continue' before the
permission pass.

Stash server-scoped permission entries during the per-file pass and drain them
for every server that actually loaded, once agent, legacy and registry servers
are all known.

(cherry picked from commit 1dd370212771dfe33a36d352059063fa61ffa4ef)

* fix(amazonq): honour configured MCP tool call timeout (#2935)

* fix(amazonq): pass configured MCP timeout to the SDK request options

MCP tool calls were capped at the SDK's 60s default request timeout because
McpManager.callTool never passed RequestOptions to client.callTool. A
configured timeout above 60s only armed the outer Promise.race, which can
shorten but never extend the deadline, so the SDK cancelled first with
'MCP error -32001: Request timed out'. timeout: 0 ('no timeout') was capped
at 60s for the same reason.

Resolve the effective timeout once and hand it to the SDK, mapping 0 to the
largest value setTimeout honours and falling back to the 60s default (with a
warning) for negative, non-finite or over-large values.

* test(amazonq): type MCP warning logger arguments

(cherry picked from commit 92ca07299c7453601498bb70d459236b6f7707bf)

* fix(amazonq): say so when a request fails on a usage limit (#2938)

A usage-limit condition surfaced as the bare 'Request failed after 3
attempts', which is indistinguishable from generic retry exhaustion. The
actionable text ('Monthly limit reached') exists only in ResponseError.data,
so clients that surface ResponseError.message - as the Eclipse plugin does
when the structured payload is absent - told the user nothing, prompting
logout/reinstall cycles for an account quota.

Name the cause in the message while keeping the attempt count for support.

(cherry picked from commit 4fa62f70399f367668c7b528c1af7e917eb06974)

* chore(chat-client): use Mynah UI 4.40.5 beta (#2955)

(cherry picked from commit d8759bb55136f2503a595d352444be39e72d2194)

* fix(amazonq): mark oversized file context as truncated instead of cutting silently (#2871)

File content added as chat context is capped at workspaceChunkMaxSize with a plain substring, so the model receives only the beginning of large files and has no way to know the file continues. It then reports the wrong file size (e.g. "this file only has 251 lines") instead of reading the rest with its tools.

Add truncateContextContent() which appends an explicit truncation marker (including the real character count) while keeping the result within the same size budget, and use it for innerContext in AdditionalContextProvider. Add unit tests.

(cherry picked from commit 2fa273711cf60a3f76235910bfbaebbd4facf465)

* chore(chat-client): bump mynah-ui to 4.40.5

(cherry picked from commit 5be2d6b4f7dbc20d30ece7fe595634391a7dcdde)

---------

Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>

* feat: AWS Transform: IAM (SigV4) authentication in the language server (#2948)

* feat(amazonq): add IAM (SigV4) auth path for AWS Transform FES calls

Parallel to the existing IdC bearer flow: the IDE pushes IAM credentials via
aws/credentials/iam/update and the tenant URL via aws.atx configuration, and
the language server SigV4-signs FES calls when both are present. Bearer path
unchanged.

- AtxTokenServiceManager: getAuthType(), getIamCredentials() (reads the main
  credentials provider's iam slot), IAM-aware hasValidCredentials(), and an
  applicationUrl setting on the aws.atx section.
- atxTransformHandler: addAuthToCommand() SigV4-signs on the IAM path (service
  transform, region from the tenant URL), headers set case-insensitively
  before signing; verifySession() validates IAM credentials on that path;
  not-signed-in fails before any network call. Secret-safe logging.
- Declare @smithy/signature-v4 and @aws-crypto/sha256-js.
- Tests for auth-type/credential/tenant-URL handling and bearer vs IAM vs
  not-signed-in signing.

* feat(amazonq): clear AWS Transform IAM session on IAM credentials delete

On aws/credentials/iam/delete the runtime clears the IAM credentials slot. The
AWS Transform service manager now also clears the IAM tenant URL and resets its
cached FES client, so no IAM session state is kept after sign-out. Uses the
existing runtime notification; no new LSP method.

- amazonQServer forwards IAM credential deletions to AtxTokenServiceManager.
  Bearer deletions keep their existing handling.
- AtxTokenServiceManager handles IAM deletion. The bearer token is untouched.
- Tests for the cleared state, bearer token unaffected, and IAM-only forwarding.

* feat(amazonq): honor client declared AWS Transform auth mode

Add an aws.atx authType setting (iam or bearer) that the client sends with
each sign-in. When declared, getAuthType reports only that mode, so stale
credentials of the other type are never used to call FES. Switching to
bearer clears the IAM tenant URL and resets the cached FES client through
the same path as the IAM credentials delete. The IAM credentials delete
also resets a declared iam mode.

Without a declared mode the auth type is derived from the credentials
present, as before.

* feat(amazonq): add AWS Transform session validation command

Add aws/atxTransform/validateSession, a read-only check the client runs
before reporting IAM sign-in as connected. It makes one ListWorkspaces call
with maxResults 1 through the same signing, tenant URL and permission path
as real requests, and never goes through the create path.
listOrCreateWorkspace is unchanged.

Failures are classified where the typed SDK error is available, into
ExpiredCredentials, MissingPermission, TenantNotFound, NetworkOrService or
Other. The response carries only the reason, error name and HTTP status,
and only those are logged, never the error message or credential values.

FES returns AccessDeniedException for expired or invalid security tokens
and for signature mismatches, so AccessDeniedException is checked against
reason INVALID_SESSION and two fixed AWS phrase lists, kept together in
atxSessionValidation.ts. A signature mismatch is reported as Other.

* fix(amazonq): classify SigV4 INVALID_SESSION errors instead of reporting expired

FES returns AccessDeniedException with reason INVALID_SESSION on the SigV4
path for several cases that are not expired credentials, so session
validation showed an expired message for all of them.

- New reasons, matched on the FES message (lowercase phrase match):
  - IamAuthNotEnabled: SigV4ProfileResolutionHandler, SigV4 access is not
    enabled for this profile (IAM authentication off in the Transform
    profile settings).
  - IamAuthNotEnabledForAccount: SigV4FeatureFlagHandler, SigV4 access is
    not enabled for account.
  - TenantMismatch: SigV4ProfileResolutionHandler, credentials do not match
    the provided tenant.
- Expired and invalid security token phrases still map to
  ExpiredCredentials, and signature mismatch still maps to Other.
- INVALID_SESSION with an unrecognized message now maps to Other instead of
  ExpiredCredentials. If FES rewords a message, it falls back to Other.
- The FES message is never logged or returned (the account message contains
  the account ID); only the reason, error code and status are.

Tests for each reason, the fallbacks, and that no message text or account ID
leaks into the result or the log.

* fix(amazonq): return error code and status for failed AWS Transform commands

Failed AWS Transform commands returned only an error flag and message, so
the IDE could not tell AccessDenied apart from other failures and kept
polling. Add errorCode and statusCode to the error result, and return the
GetJob error code and status with JOB_NOT_FOUND. The error message is
unchanged and never parsed by the client.

* fix(amazonq): validate the AWS Transform tenant URL for IAM (SigV4) auth

The aws.atx application URL is kept only when it is an https AWS Transform URL in a
region with an FES endpoint, reduced to its origin. On IAM, the region comes only
from a valid URL (no default region fallback), and requests are not signed without
one. The IdC path is unchanged.

* chore(release): release packages from branch main (#2981)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.84.0 (#2989)

Co-authored-by: aws-toolkit-automation <>

* fix(lsp-yaml): load the schema once instead of on every request (#3017)

* fix(lsp-yaml): load the schema once instead of on every request

YamlLanguageService called configure() before every hover, completion,
validation and format request. configure() clears the schema cache, so
each request downloaded and parsed the 17.5 MB SAM schema again. This
made the CloudFormation completion integ test exceed its 8s timeout on
Windows runners.

Configure the service once in the constructor with the same settings
and a '*' file match, so the schema is fetched and resolved once per
server process.

* fix(lsp-yaml): reload the schema after a failed load

Loading the schema once means a failed load stayed cached for the life of
the process. Before, the per-request configure() cleared the cache, so the
next request fetched the schema again.

Record when the resolver throws, returns content that is not JSON, or the
default fetch gets a non-OK response, and re-run configure() on the next
request in that case only. A successful load is still fetched once, and
the returned content and diagnostics are unchanged.

* fix: update bundled Node.js to 24.22.2 for CVE-2026-111497 (#3026)

Node.js 24.9.0 is affected by CVE-2026-111497, which is fixed in
Node.js 24.22.1. The 24.9.0 pin was a temporary workaround for a
Node.js release issue that has since been resolved.

* ci: open a pull request when a newer bundled Node.js release is available (#3027)

A daily workflow now opens a draft pull request that updates NODE_SEMVER
when Node.js publishes a newer release on the bundled major line, after
checking the new files against their published checksums.

download-node.sh now verifies the SHA-256 of each file, stops on HTTP
errors, and stops when a platform file is missing from the release.

* chore(release): release packages from branch main (#3022)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.85.0 (#3034)

* fix: address security issues (#3041)

* fix(identity): validate section and setting names when saving profiles

- Accept only the profile and sso-session settings that the store
  loads.
- Require section names that the AWS SDK reads back as the same
  section.
- Write each section header and setting on a single line.

* fix(identity): preserve shared config file modes when saving

- Create the rewritten file with the mode of the file it replaces, or
  0600 for a new file.
- Keep credentials files owner-only, including the backup.
- Create a new shared config directory with 0700.

* fix(amazonq): limit diff and similarity work for large edit suggestions

- Compute the accepted-edit character diff with two rows instead of a
  full table, skip the common prefix and suffix, and approximate it
  when the table would exceed 1,000,000 cells.
- Compare rejected edits by edit distance only up to 2,000 characters.
  Longer edits match only an identical rejection, which is unchanged
  for the default threshold of 1.0.

* fix(amazonq): keep workspace rule resources inside the workspace

- Load absolute resource paths only from the global agent config.
- Load workspace rule files only from inside the workspace folder.
- Log each resource that is skipped.

* fix(amazonq): reserve built-in tool names for MCP tool registration (#2982)

* fix(amazonq): reserve built-in tool names for MCP tool registration

MCP tool names came from a server's tools/list and were used in their
bare form whenever the name was not already in the collision set. That
set was not seeded with the built-in tool names, so a server could
register under one and replace the built-in entry.

createNamespacedToolName now takes a reservedNames set, never returns a
reserved name from any naming branch, and discards a persisted name
mapping that points at one. Both call sites seed the set from
agent.getBuiltInToolNames() so the reservation tracks tool registration.
MCP cleanup paths skip built-in names.

* fix(amazonq): dispatch tool confirmation on the registered tool name

processToolConfirmation resolved its switch subject as toolType ||
toolUse.name. The MCP branch passes the server's original tool name as
toolType for display, so a tool advertised as fsRead selected the
built-in fsRead card, which reads input.paths and threw "Paths array
cannot be empty." before any approval card was shown. The same name
also drove the isStandardTool classification and the executeBash body
check.

Dispatch and classification now use toolUse.name, the registered name,
which is namespaced for MCP tools. toolType stays display-only.

* fix(amazonq): guard optional tool name in confirmation classification

ToolUse.name is string | undefined, so the isStandardTool check needs
the undefined guard that the previous expression carried. Restores it
on the dispatch name. An undefined name classifies as non-built-in.

* test(amazonq): cover reserved built-in names in MCP tool naming

Adds cases for every built-in name, two servers advertising the same
built-in name, re-registration reusing the namespaced name, truncation
of a long server name, the numeric-suffix fallback skipping a reserved
candidate, and the default empty reserved set keeping prior behavior.

* test(amazonq): cover sanitized names that collapse onto a built-in name

sanitizeName strips disallowed characters, so an advertised name such as
"fs Read" becomes "fsRead". The reserved check runs on the sanitized
form; this pins that behavior.

* fix(amazonq): key remaining tool-name branches on the registered name

getUpdateToolConfirmResult resolved its subject as originalToolName,
which is the server's original tool name on the MCP approval path. A
tool advertised as executeBash therefore rendered the shell card, which
reads input.command, and one advertised as a filesystem tool selected
those cases. Dispatch now uses toolUse.name; originalToolName and
toolType remain display-only. The built-in path already passes
toolUse.name, so built-in rendering is unchanged.

getMessageIdForToolUse no longer branches on toolType, so a server
cannot steer a card to the built-in executeBash message id. The
parameter is now unused and is removed.

The Built-in tool list in mcpEventHandler selected tools by excluding
raw MCP tool names, which hid a built-in whose name an MCP server also
advertises. It now selects by getBuiltInToolNames().

* fix(amazonq): keep unclassified tools in the Built-in list

The previous commit selected the Built-in list purely by
getBuiltInToolNames(), which dropped the three LSP tools that register
without a ToolClassification and were previously listed.

The filter is now additive: a built-in is always listed, and any other
tool is listed unless it matches an MCP tool name. The MCP name set also
includes the namespaced names tools are actually registered under, so a
colliding MCP tool is excluded rather than appearing alongside the
built-in it shadowed.

* test(amazonq): cover MCP tools whose name matches a built-in tool

Drives processToolUses with an MCP tool registered as probe___fsRead
whose server-advertised name is fsRead, and asserts the server's name
never selects built-in behavior: the confirmation card is the MCP
summary card rather than the built-in read card, the built-in path
validation error does not surface, the MCP permission is consulted
under the server and original tool name, runTool receives the
registered name, and the accepted-result card is the MCP card.

A second case registers probe___executeBash and asserts no card renders
as the shell command card and the confirmation uses the plain
toolUseId rather than the shell tool's message id.

* fix(amazonq): reserve statically dispatched tool names

* fix(amazonq): require workspace containment before opening chat card files (#2906)

* fix(amazonq): require workspace containment before opening chat card files

onFileClicked passed card paths to showDocument with no containment
check. The fsRead branch opened params.filePath directly, the default
branch opened params.fullPath directly, and resolveAbsolutePath joined a
relative filePath onto the workspace root, so a traversing relative path
escaped as well. Card paths originate in model tool results and service
findings, so a manipulated response plus one click opened any readable
file and fed it to completion context.

All three open paths now go through openIfAllowed, which canonicalizes
the path and reuses requiresPathAcceptance: a file opens only when it is
inside a workspace folder or the user already approved it for the card's
tool in this session. The user prompts directory is allowed for
.prompt.md files, which resolveAbsolutePath deliberately resolves there.
Refused clicks are logged and otherwise ignored.

Tests cover an inside file, an outside fullPath, an escaping relative
path, an fsRead card for an unapproved and an approved outside path, an
fsWrite approval not unlocking an fsRead card, a prompt file in the
prompts directory, and a non-prompt file in that directory.

* fix(amazonq): prompt before opening an out-of-workspace chat card file

The previous commit refused such opens outright and only logged. A card
can legitimately point outside the workspace, for example a findings
path the user wants to inspect, so the open is now gated by a warning
dialog instead of dropped.

openIfAllowed shows a showMessageRequest warning with Open and Cancel
when requiresPathAcceptance requires acceptance. The message leads with
the specific reason the check returned, such as the sensitive-file
warning, and names the canonical path. Choosing Open records the path
for the card's tool in the session's approved paths, so a repeat click
or a later tool use on the same path does not prompt again. Cancel or
dismissal aborts the open. In-workspace, already-approved, and prompt
directory paths open without a dialog as before.

MessageType and MessageActionItem are imported from the protocol module,
which already supplied MessageType to this file; a second import from
server-interface produced a duplicate identifier.

Tests cover the dialog contents and action order, Open opening the file,
Cancel and dismissal refusing, the choice being remembered across
clicks, the sensitive-path reason surfacing in the dialog, and existing
approvals suppressing the dialog.

* fix(amazonq): normalize Windows paths in approval lookup

Match single backslash separators consistently with session approval storage.
Normalize Windows paths before sensitive-location pattern checks.
Add session round-trip tests for drive and UNC paths and use native separators
in the sensitive-path fixture.

* fix(amazonq): open file links from chat answers in the editor (#3016)

* fix(amazonq): open file links from chat answers in the editor

* fix(amazonq): handle Windows file links

* fix(amazonq): detect sensitive Windows paths

* fix(amazonq): separate file-open consent

* fix(amazonq): refine chat file-link handling

- Keep encoded '#' and '?' in file names and accept 'file.ts:10' line suffixes.
- Tell the user when a link is not opened or a linked file is not found.
- Keep link-click telemetry for links handled inside chat.
- Retain an fsRead Open choice only for paths an fsRead call requested, and say so in the dialog.

* fix(amazonq): bound not-found message and match home-relative fsRead paths

* fix(amazonq): retain fsRead Open choice only for regular files

* fix(amazonq): check regular files with node fs for fsRead retention

* test(amazonq): cover forward-slash and ~user fsRead inputs

* fix(amazonq): require exact approval for sensitive paths

- Credential and system paths need their own approval, not a parent
  directory's. This also applies to the executeBash working directory.
- A file with more than one hard link needs approval in fsRead, fsWrite,
  fsReplace and grepSearch, and as an executeBash file argument. An
  approval covers such a file only while it is the same file with no
  more names.
- Keep executeBash file checks for approved paths.
- Record an approved path after the tool succeeds, and for executeBash
  only when the command exits normally. An executeBash approval allows
  the working directory only for an out-of-workspace prompt of a
  read-only command, and never the home folder, a folder above it, or a
  hidden or settings folder.

* fix(amazonq): show the full command in shell command cards

- Use a code block fence that is longer than any run of backticks in the
  command, in the approval card and the other shell command cards.

* fix(amazonq): ask before modifying workspace configuration files

- Ask before fsWrite or fsReplace modifies files in .amazonq, .vscode,
  or .git folders in the workspace, including linked folders, the
  AmazonQ.md rules file, or the global Amazon Q configuration when the
  workspace includes it.
- Memory bank generation can still write its own files, only in the
  request that asked for the memory bank.

* test: run every unit test file to completion

* feat(amazonq): start local MCP servers only in trusted workspace folders (#3019)

* fix(amazonq): explain why local MCP servers wait for workspace trust (#3039)

List servers held by the workspace trust check under "Waiting for trust"
with what starts them, instead of under Disabled, and keep such a server
when it is saved.

* fix(amazonq): stricter checks for chat file links and configuration files (#3042)

fix(amazonq): stricter checks for chat file links and configuration files

---------

Co-authored-by: hezelin <hezelin@amazon.com>

* chore(release): release packages from branch main (#3045)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.86.0 (#3050)

Co-authored-by: aws-toolkit-automation <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: XiaowenMaoA <107279155+XiaowenMaoA@users.noreply.github.com>
Co-authored-by: Dung Dong <dungdong@amazon.com>
Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
Co-authored-by: tomar-gunjan <tomgun@amazon.com>
Co-authored-by: Boyu <bywang@amazon.com>
Co-authored-by: invictus <149003065+ashishrp-aws@users.noreply.github.com>
Co-authored-by: hezelin <hezelin@amazon.com>

* docs(amazonq): record the launch request's build configuration in the ATX models (#3072)

AtxAppLaunchApp.configuration and AtxAppLaunchResult.configuration, mirroring
the C# classes in the VS extension. The IDE reads request.json from the
downloaded artifact itself, so these interfaces are the contract's documentation
rather than something the language server parses, and no forwarding code
changes: the field reaches the IDE already.

The IDE side (build and start in the requested configuration, matched against
the ones the project declares) is in the toolkit's companion change.

* chore: merge main into feature/ITGen-RIV (Node 24.22.3, IAM auth follow-ups) (#3073)

* chore(release): release packages from branch main (#2959)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: bump agentic version: 1.83.0 (#2973)

Co-authored-by: aws-toolkit-automation <>

* chore: merge feature/OHI fixes to main (#2978)

* fix: stop pinned context leaking to new chat windows (#2786)

addPinnedContext aliased the shared module-level DEFAULT_PINNED_CONTEXT
array and then mutated it with unshift/push. Pinning context in one tab
therefore polluted the default, so every new chat window inherited that
pinned item and it could not be removed. getPinnedContext also returned
the shared default array directly.

Copy the default array in both places so pinning in a tab no longer
mutates the shared default. Adds a regression test.

(cherry picked from commit e31138996f5720cf2b7244afdba05f897026ed3e)

* fix(amazonq): stop memory bank analysis from blocking the language server (#2927)

The memory bank TF-IDF step stored dense, vocabulary-wide vectors and built a
union Set of both vectors for every one of the N^2 file pairs. On a large
workspace this ran for over a minute synchronously on the language server
event loop, so other requests, such as a new chat tab's pinned context and
rules, were not handled until it finished.

- Build sparse TF-IDF vectors with precomputed norms, count document
  frequency once per document, and compute only the upper triangle of the
  cosine matrix. Results are unchanged.
- Yield to the event loop periodically during the analysis.
- Fix the "20KB" size filter, which compared line counts instead of
  characters and let multi-megabyte single-line files through.

* refactor(amazonq): clarify cosine similarity variable names

(cherry picked from commit c812bea34018486f3e7026da74fc480682d50591)

* fix(amazonq): match recorded approvals for Windows paths(#2939)

isPathApproved normalized separators with a pattern that only matched
doubled backslashes, so Windows paths never matched approvals recorded
for a parent folder or for the same path in a different separator form.
Normalize separators and compare paths consistently, and add tests for
multi-path reads and Windows-style paths.

(cherry picked from commit a4941a4f5cab5f1f40d03ce8eb05f7ca280eba57)

* fix(amazonq): restore MCP permissions for legacy and duplicate servers (#2936)

MCP 'Always Allow' reverted to 'Ask' after every restart or MCP refresh for
servers declared in a legacy mcp.json. updateServerPermission writes the
'@server/tool' entries into agents/default.json but deliberately omits the
server definition, while loadAgentConfig only re-applied '@'-prefixed entries
while iterating the same file's mcpServers block. Legacy servers have no such
entry, so their permissions were dropped on every load; duplicate
workspace/global servers hit the same gap because they 'continue' before the
permission pass.

Stash server-scoped permission entries during the per-file pass and drain them
for every server that actually loaded, once agent, legacy and registry servers
are all known.

(cherry picked from commit 1dd370212771dfe33a36d352059063fa61ffa4ef)

* fix(amazonq): honour configured MCP tool call timeout (#2935)

* fix(amazonq): pass configured MCP timeout to the SDK request options

MCP tool calls were capped at the SDK's 60s default request timeout because
McpManager.callTool never passed RequestOptions to client.callTool. A
configured timeout above 60s only armed the outer Promise.race, which can
shorten but never extend the deadline, so the SDK cancelled first with
'MCP error -32001: Request timed out'. timeout: 0 ('no timeout') was capped
at 60s for the same reason.

Resolve the effective timeout once and hand it to the SDK, mapping 0 to the
largest value setTimeout honours and falling back to the 60s default (with a
warning) for negative, non-finite or over-large values.

* test(amazonq): type MCP warning logger arguments

(cherry picked from commit 92ca07299c7453601498bb70d459236b6f7707bf)

* fix(amazonq): say so when a request fails on a usage limit (#2938)

A usage-limit condition surfaced as the bare 'Request failed after 3
attempts', which is indistinguishable from generic retry exhaustion. The
actionable text ('Monthly limit reached') exists only in ResponseError.data,
so clients that surface ResponseError.message - as the Eclipse plugin does
when the structured payload is absent - told the user nothing, prompting
logout/reinstall cycles for an account quota.

Name the cause in the message while keeping the attempt count for support.

(cherry picked from commit 4fa62f70399f367668c7b528c1af7e917eb06974)

* chore(chat-client): use Mynah UI 4.40.5 beta (#2955)

(cherry picked from commit d8759bb55136f2503a595d352444be39e72d2…
…/1.87.0

chore: merge agentic version 1.87.0
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.