Azure / Azure/azure-functions-agents-runtime
Detect HTTP route conflicts and invalid main.agent.md triggers at startup
- Dominant language
- Python
- Stars
- 9
- Forks
- 7
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 20
Description
## Problem
The runtime should fail fast when two agent files register conflicting HTTP surfaces or when `main.agent.md` declares unsupported triggers.
Current risks:
- Two non-main HTTP agents can declare the same `trigger.args.route`; registration does not currently track route uniqueness.
- `main.agent.md` is documented as the file that creates built-in chat/API/MCP endpoints, not normal triggers, but trigger behavior is not enforced clearly.
- A `main.agent.md` `http_trigger` can be silently skipped, which hides an authoring mistake.
- Route conflicts with built-in debug endpoints may be hard to diagnose if they are not checked explicitly.
These are preview-breaking behavior decisions: after customers depend on route registration behavior, changing from skip/overwrite to fail-fast becomes more disruptive.
## Proposal
Add startup-level validation for route and trigger conflicts.
Recommended behavior:
- Track HTTP routes registered by `.agent.md` HTTP triggers and debug endpoints.
- Fail fast when two agent files claim the same route/method combination, naming both source files where possible.
- Fail fast when a non-main HTTP agent omits `trigger.args.route` or uses an invalid route shape.
- Fail fast when `main.agent.md` declares a normal trigger, unless we intentionally decide to support main-agent triggers and document that behavior.
- Replace silent skips with validation errors that point to the relevant docs section.
## Required docs and sample updates
- Update README and `docs/triggers.md` to state that route conflicts are startup errors.
- Update `docs/front-matter-spec.md` around `main.agent.md` and trigger rules.
- Update any samples if they rely on routes that would now conflict with built-in debug endpoints.
- Add tests for duplicate HTTP routes and `main.agent.md` trigger validation.
## Acceptance criteria
- Duplicate HTTP route/method registrations fail startup with a clear error.
- `main.agent.md` trigger behavior is explicit and enforced.
- Silent skipping of `main.agent.md` `http_trigger` is removed or replaced by a clear validation error.
- Tests cover duplicate routes, route/method normalization, and main-agent trigger validation.
- Docs and samples reflect the final route/trigger rules.
Contributor guide
Research direction
Start by tracing startup registration for .agent.md HTTP triggers and built-in debug endpoints. Read README, docs/triggers.md, and docs/front-matter-spec.md for the documented rules, then inspect samples for route assumptions. Done means duplicate route/method registrations and invalid main.agent.md triggers fail clearly at startup, with tests and documentation covering the final behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend, documentation, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100