Add a loop-harness agent example - #1165
PratikDhanave (PratikDhanave) wants to merge 1 commit into
Conversation
Go has full loop-harness support (agent/harness/loop) but no sample demonstrating it, unlike the .NET Harness samples. Add a get-it-working example that wraps a Foundry agent with the loop middleware and a completion-marker evaluator so the agent keeps working across turns until it signals completion, and register it with cmd/verifyexamples (env-gated on FOUNDRY_PROJECT_ENDPOINT like the sibling agent samples).
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Only a non-blocking documentation nit remains.
Review effort: Lite
Findings: None
What changed in this PR
Adds a Foundry-backed loop-harness agent example and registers it for environment-gated verification.
Changes:
- Demonstrates completion-marker loop middleware.
- Registers the sample with
verifyexamples.
| File | Summary |
|---|---|
examples/02-agents/harness/step01_loop/main.go |
New Foundry loop-harness sample. |
cmd/verifyexamples/examples.go |
Registers the sample for verification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Scope: examples Changed Go contract: None (no exported API added/changed). New example Upstream evidence reviewed: Result: aligned. This PR only adds a new example and registers it in the example-verification harness; it introduces no new or changed exported Go API and no behavior change to
|
Go has full loop-harness support (
agent/harness/loop) butexamples/has no sample demonstrating it — the .NET samples include aHarnessset (Harness_Step05_Loop), and the parity doc lists "richer sample coverage" as a gap.Change
examples/02-agents/harness/step01_loopthat wraps a Foundry agent with the loop middleware + a completion-marker evaluator, so the agent keeps working across turns until it ends a response with theTASK COMPLETEmarker.cmd/verifyexamples(env-gated onFOUNDRY_PROJECT_ENDPOINT,FOUNDRY_MODELoptional), matching the sibling agent samples. It skips cleanly when credentials are absent.Builds,
go vet, andgofumptclean; theverifyexamplestest passes and the new entry is discovered and skips without credentials.