Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: 1

sample:
owner: sapsing
experiences: [azd, vscode]

tests:
- name: validates-response-and-session-stores
turns:
- input: Remember the exact marker INC-2301 for my next message. Reply briefly.
- input: |
What exact marker did I ask you to remember? Then call
inspect_custom_store exactly once and include its result verbatim.
assertions:
- source: assistant_text
type: contains
value: INC-2301

- source: assistant_text
type: regex
value: 'response_store=[1-9][0-9]*'

- source: assistant_text
type: regex
value: 'agent_session_store=[1-9][0-9]*'

- name: validates-checkpoint-store
turns:
- input: |
Call validate_checkpoint_store exactly once with marker CHK-2301.
Include the tool result verbatim.
assertions:
- source: assistant_text
type: contains
value: CHECKPOINT_STORE_OK CHK-2301

- name: validates-function-approval-store
turns:
- input: |
Call approve_incident_change exactly once with change_id CHG-2301.
Include the tool result verbatim after approval.
approvals:
mcp:
- server_label: agent_framework
name: approve_incident_change
assertions:
- source: assistant_text
type: contains
value: APPROVAL_STORE_OK CHG-2301

- name: confirms-all-four-stores-contain-data
turns:
- input: Call inspect_custom_store exactly once and include its result verbatim.
assertions:
- source: assistant_text
type: regex
value: 'response_store=[1-9][0-9]*'

- source: assistant_text
type: regex
value: 'agent_session_store=[1-9][0-9]*'

- source: assistant_text
type: regex
value: 'checkpoint_store=[1-9][0-9]*'

- source: assistant_text
type: regex
value: 'function_approval_store=[1-9][0-9]*'
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
description: Coding agent guidance for the custom store hosted-agent sample
---

# Coding Agent Instructions

This sample is a Microsoft Foundry hosted Agent Framework agent served through
the Responses protocol. It replaces all four hosting storage extension points
with custom Redis-backed implementations: the Responses store, the agent
session store, the workflow checkpoint store, and the function approval store.

## Key files

* `azure.yaml` defines the Foundry project, model, agent, runtime configuration,
deployed environment variables, and the layered infrastructure (Foundry layer
plus a Bicep layer that provisions Azure Managed Redis).
* `docker-compose.yml` runs a local Redis for `python main.py` development.
* `infra/redis/main.bicep` provisions Azure Managed Redis, grants the Foundry
project managed identity a data access policy, and exports its `REDIS_HOST`
and `REDIS_PORT` outputs consumed by `azure.yaml`.
* `src/agent-framework-agent-custom-store-responses/main.py` creates the agent
and supplies the response store plus the three store providers to
`ResponsesHostServer`.
* `src/agent-framework-agent-custom-store-responses/redis_database.py` owns the
shared async Redis client, key namespacing, and per-user partitioning helper.
* `src/agent-framework-agent-custom-store-responses/redis_response_store.py`
implements `ResponseProviderProtocol`.
* `src/agent-framework-agent-custom-store-responses/redis_state_stores.py`
implements the session, checkpoint, and function approval stores and their
providers.
* `README.md` documents local and hosted execution paths.

Preserve per-user partitioning, namespaced keys, and native key TTLs when
changing the stores. All four stores share one Redis instance and each owns its
own key prefix.

Do not commit `.vscode` launch or task files generated by Foundry Toolkit. Keep
the service virtual environment beside `requirements.txt` under the service
directory.

## Development workflow

Use `azd` from an initialized agent project:

```

azd provision
azd ai agent run
azd ai agent invoke --local "your message"
azd deploy
azd ai agent invoke "your message"

```

This project was built with the `microsoft-foundry` skill. Before working on or
answering questions about Foundry agents, read the `vscode-microsoft-foundry`
skill first when using VS Code, then read the `microsoft-foundry` skill.

## References

* [Hosted agents overview](https://learn.microsoft.com/azure/foundry/agents/concepts/hosted-agents)

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: Claude Code entry point for the sample coding agent instructions
---

# Claude Code Instructions

This project uses [AGENTS.md](./AGENTS.md) as the source of truth for coding
agent instructions.

@AGENTS.md
Loading
Loading