You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
state-stores list
state-stores select [store-name]
state-stores show [store-name]
state-stores items list
state-stores items show <key>
state-stores items set <key>
state-stores items delete <key>
Reuse agent_api.AgentClient, with focused State Store operations/models rather than a new client.
Save one active store per project endpoint and deployed agent name. Explicit targets do not change selection; protocol and version do not partition it.
Support project/service resolution and explicit endpoints outside a project. Honor --environment without falling back to another environment's deployment metadata.
Accept object-valued inline/file/stdin input while preserving JSON number precision. set upserts via one PUT and replaces the complete value/tag map.
Preserve If-Match, reject stale writes without an unconditional fallback, and require delete confirmation or --yes.
Add forward-only, single-page cursor pagination (--after + --limit, with --order), JSON/table output, a paged store picker, documentation, help snapshots, and regression tests.
Store creation/update/deletion, create-only item writes, delegated identity flags, and list-time tag filtering are out of scope.
Size policy: The public service limits state 1 MB of serialized JSON per item value. The code uses the service's byte definition, 1,048,576 bytes (1 MiB), as one shared constant for value validation and the raw-input guard—no arbitrary multiplier. The raw guard conservatively includes whitespace, so larger formatted input must be compacted externally first. The serialized-value check accounts for JSON escaping and excludes the request envelope and tags; undocumented larger-value behavior is not assumed.
Validation
From the agents extension module:
go build
go fix ./...
go test ./... -short -count=1
Focused race tests for State Store commands/client, configuration validation, and agent resolution
golangci-lint v2.11.4 on the affected command/API packages: 0 issues
Azure Pipelines:
Successfully started running 2 pipeline(s).
23 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
Azure Pipelines:
Successfully started running 2 pipeline(s).
23 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.
Store names come from the service and the contract permits arbitrary strings beyond length bounds. Passing them directly as prompt labels allows embedded terminal control sequences to be rendered when the picker opens. Encode control characters in Label while keeping the original name in Value/selection logic.
Sanitize terminal control characters in table output
These table columns render .Name verbatim for both service-provided store names and item keys. PrettyTableFormatter preserves terminal escape-bearing values in full/compact layouts, so a crafted key can inject terminal control sequences during --output table. Encode control characters for display while retaining raw values in JSON output and API operations.
Write responses omit tags, so itemDetail.Tags is nil even when the request successfully set tags; this prints Tags: null and falsely suggests the resulting item has no tags. Only render the Tags detail when the response actually includes it.
Write responses intentionally omit tags (the new response test exercises this), but this field re-encodes an omitted property as "tags": null in the default JSON output. After a successful write with --tag, that looks like the tags were cleared. Preserve the service omission in JSON output.
Non-HTTP write failures still lose the write-safety guidance. A timeout or connection reset from pipeline.Do reaches this fallback rather than the status-code branch, even though the service may already have committed the PUT/DELETE; the resulting internal error has no suggestion and a retry can overwrite or misreport state. Preserve auth/cancellation guidance, but classify transport failures from items set and items delete with “check the item's current state before retrying,” and cover that path with a transport-error test.
Latest Copilot follow-up is in 8ca7176: display-only identifier escaping, omitted response-tag preservation, and uncertain-write transport/decode guidance with focused tests. Full extension short tests, State Store race tests, scoped lint, spell checks, and diff checks pass. CI triage is documented in the PR description: GitHub Tier 1 reproduces on the exact base commit; ADO Tier 2 hit the shared subscription deployment-history quota before deployment. No retained State Store test resources were changed.
Handle output failures differently after items set and items delete. At this point execute has already received and decoded a successful service response, so returning a generic stdout error can lead automation to retry a mutation that already committed. Report that the write succeeded but its result could not be written, and advise inspecting current state before retrying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10081.
Add
azd ai agent state-storessupport for the publicly documented durable State Store for Microsoft Foundry hosted agents (public preview), to inspect existing stores and manage their JSON object items:agent_api.AgentClient, with focused State Store operations/models rather than a new client.--environmentwithout falling back to another environment's deployment metadata.setupserts via one PUT and replaces the complete value/tag map.If-Match, reject stale writes without an unconditional fallback, and require delete confirmation or--yes.--after+--limit, with--order), JSON/table output, a paged store picker, documentation, help snapshots, and regression tests.Store creation/update/deletion, create-only item writes, delegated identity flags, and list-time tag filtering are out of scope.
Size policy: The public service limits state 1 MB of serialized JSON per item value. The code uses the service's byte definition, 1,048,576 bytes (1 MiB), as one shared constant for value validation and the raw-input guard—no arbitrary multiplier. The raw guard conservatively includes whitespace, so larger formatted input must be compacted externally first. The serialized-value check accounts for JSON escaping and excludes the request envelope and tags; undocumented larger-value behavior is not assumed.
Validation
From the agents extension module:
go buildgo fix ./...go test ./... -short -count=1git diff --check