AGENTS.md
e2e/features/agent-v2/AGENTS.mdAGENTS.md
Quality
58/100
Scores the file, not the repository.Length
825 words
10 headings · 1 code blocksRepository
151k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Agent V2 E2E23This file scopes Agent v2 conventions under `features/agent-v2/` and its step definitions. Package-wide runner, locator, assertion, lifecycle, and cleanup rules live in `e2e/AGENTS.md`.45## Scope67Agent v2 scenarios use the `@agent-v2` capability tag. The E2E web environment enables Agent v2 through `NEXT_PUBLIC_ENABLE_AGENT_V2=true`.89Cover user-observable Configure, Build draft, saved configuration, publish, Access Point, files, advanced settings, and runtime behavior. Do not keep readiness-only, unavailable, or permanently skipped scenarios. Use API setup for prerequisites, then assert visible behavior or a persisted public contract.1011## Execution tags1213- `@core` — stable, non-runtime user behavior.14- `@prepared` — deterministic user behavior that requires the checked-in post-merge seed.15- `@external-model` — execution can call a real model provider.16- `@external-tool` — execution can call a real third-party tool provider.17- `@agent-backend-runtime` — execution requires the standalone `dify-agent` server and shellctl sandbox.18- `@web-app-runtime` — published Web app chat behavior.19- `@service-api-runtime` — Backend service API chat behavior.20- `@microphone` — isolated Chromium context with the fake audio fixture.2122Fixture tags such as `@stable-model`, `@tool-fixture`, `@knowledge-fixture`, `@full-config-agent`, `@tool-states-agent`, `@dual-retrieval-fixture`, and `@workflow-reference` describe the concrete seeded dependency. They do not change execution by themselves.2324Use `@external-model` and `@external-tool` only for runtime calls. A scenario that merely selects or persists an active model or tool is `@prepared`, not external.2526## Step organization2728Keep steps grouped by Agent product capability, such as configuration, Build draft, resource configuration, lifecycle, Access Point, and runtime behavior. Group by the domain action that owns the wording instead of mechanically pairing a step file with each feature file. Fixture-resolution steps should remain separate from behavior steps because they validate environment readiness rather than perform a user journey.2930Cucumber step definitions are globally registered. Do not duplicate step text across files.3132## World state3334Agent v2 state belongs under `world.agentBuilder`:3536- `fixtures` stores resolved models and seeded resources.37- `accessPoint`, `configure`, `speechToText`, and `workflow` store per-scenario state.3839Do not add Agent v2 fields to the top level of `DifyWorld`. Store created Agent IDs, drive files, and tool credentials in the existing typed cleanup fields.4041## Setup boundary4243Use `a basic configured Agent v2 test agent has been created via API` for model-free, scenario-owned state. Use `a runnable Agent v2 test agent has been created via API` only after resolving the stable model fixture. Use the agent-decision variant only for autonomous planning or resource-selection behavior.4445API setup may create scenario-owned Agents, workflows, drafts, access toggles, and files. Register every created resource for cleanup. Do not mutate a fixed seeded fixture to make a scenario pass.4647Use `the Agent v2 configuration should be saved automatically` for Configure autosave. It waits for the visible publish-bar saved state; do not replace it with network-idle waits or internal store assertions.4849## Seed and fixture contract5051Seed tasks create or update environment-owned models, plugins, datasets, Agents, and workflows. `fixtures.steps.ts` resolves and validates those resources before a dependent behavior runs. Missing, inactive, unindexed, or drifted fixtures must throw and fail the scenario; never return `skipped`.5253`@prepared` scenarios are excluded from deterministic PR core. Post-merge runs:5455```bash56E2E_START_AGENT_BACKEND=1 pnpm -C e2e e2e:post-merge57```5859The command owns runtime setup, strict seed, Cucumber, and teardown. The strict seed must finish without blocked tasks. The concrete resource inventory and defaults belong to the seed profile and environment configuration rather than this guidance.6061Organize fixture helpers by the product resource or infrastructure capability they own, not by the feature file that happens to consume them. Keep runtime readiness adapters separate from Console resource fixtures, and keep all fixture state in the current `SeedContext` or scenario `DifyWorld` rather than module globals.6263Provider credentials belong to seed/admin setup, never to Cucumber steps.6465## Runtime contract6667Scenarios tagged `@agent-backend-runtime` must include `the Agent v2 runtime backend is available`. Run with `E2E_START_AGENT_BACKEND=1` to start `dify-agent` and shellctl, or point `E2E_AGENT_BACKEND_URL` / `AGENT_BACKEND_BASE_URL` to an existing server.6869Use the stable model for generic runtime behavior and the decision model only where model reasoning quality is part of the contract. Do not broaden external runtime tags to cover configuration-only scenarios.7071## Build and Preview7273Build mode covers Configure and Build draft persistence. Preview/Test Run covers real generation, runtime failure recovery, and tool or knowledge hits proven through replies. Do not add Preview scenarios until they are executable in the selected CI lane.7475## API contracts7677Import generated Console/Web/Service API types directly from `@dify/contracts/.../types.gen`. Keep local types only for E2E-owned state, fixture registry entries, helper inputs, and intentionally narrowed views. If the generated contract is incomplete, fix the backend schema and regenerate it instead of duplicating the response shape.7879Agent detail is the state owner for Agent scenarios. An Agent's backing app identifier may be used to route a shared app command, but it is not a substitute query model and must not become the final assertion source. Derive Agent Web app URLs and persisted Agent state from the generated Agent detail contract, then assert the user-visible Access Point or runtime result in the browser.80
Also in langgenius/dify
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| langgenius/difyAGENTS.md · 151k | AGENTS.md | no sections | 40/100 | today | |
| langgenius/difyapi/AGENTS.md · 151k | AGENTS.md | apiagent-behaviour | 54/100 | 3 days ago | |
| langgenius/difycli/AGENTS.md · 151k | AGENTS.md | testtypestesting-strategy | 58/100 | 3 days ago | |
| langgenius/difycli/src/commands/AGENTS.md · 151k | AGENTS.md | testlint-formatagent-behaviour | 74/100 | 3 days ago | |
| langgenius/difydify-agent/AGENTS.md · 151k | AGENTS.md | styleagent-behaviour | 58/100 | 3 days ago | |
| langgenius/difye2e/AGENTS.md · 151k | AGENTS.md | setupstyletesting-strategyapi | 72/100 | 3 days ago | |
| langgenius/difypackages/dify-ui/AGENTS.md · 151k | AGENTS.md | stylesecurityuido-not | 50/100 | 3 days ago | |
| langgenius/difyweb/AGENTS.md · 151k | AGENTS.md | teststyletesting-strategyagent-behaviour | 47/100 | 3 days ago | |
| langgenius/difyweb/features/agent-v2/AGENTS.md · 151k | AGENTS.md | agent-behaviour | 16/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago |
