Project generation model settings — Deep Dive
Project generation model settings let one project choose different GitHub Copilot model ids for three planning surfaces: blueprint generation, workflow generation, and outcome-spec drafting. The setting is project data, not a global switch. For the API contract see the reference; for the operator flow see the experience guide.
Flow
Stored fields
ProjectRecord now stores BlueprintGenerationModel, WorkflowGenerationModel, and OutcomeSpecGenerationModel (apps/Agentweaver.Api.Data/Memory/ProjectRecord.cs:26). MemoryDbContext maps them to blueprint_generation_model, workflow_generation_model, and outcome_spec_generation_model (MemoryDbContext.cs:227). The Postgres migration 20260708040300_AddProjectGenerationModelSettings.cs adds the database columns; the project response DTO and web Project type expose the same snake_case fields (apps/Agentweaver.Api/Contracts/Dtos.cs:588; apps/web/src/api/types.ts:183).
Save path
The web settings page has a Generation models section with three text fields and a Reset to inherit action (apps/web/src/pages/ProjectSettingsPage.tsx:538). Saving calls PUT /api/projects/{id}/provider-settings with the three generation model ids plus the existing default-provider fields (ProjectSettingsPage.tsx:334). The API rejects model ids that are not allowed by IsAllowedModelId and persists the three values through ProjectService.UpdateProviderSettingsAsync (apps/Agentweaver.Api/Endpoints/ProjectEndpoints.cs:270).
Blank values are saved as null, which means inherit the configured global generation default in the resolver path (ProjectSettingsPage.tsx:342).
Resolution follows project preference, per-flow configuration, shared generation model, then the built-in default. These are model preferences, not credential or provider authority. Generative operations still require effective model-provider admission, including caller/project/operation binding and pre-call provider revalidation. A saved model ID cannot bypass that fence or select an ambient credential.
Runtime consumers
- Blueprint generation reads the project, resolves
project.BlueprintGenerationModelthroughGenerationModelOptions.ResolveBlueprintModel, and passes it toBlueprintService.GenerateAsync(apps/Agentweaver.Api/Endpoints/BlueprintEndpoints.cs:58).CopilotBlueprintGenerator.GenerateRawAsyncsends thatmodelIdtoIAgentRunner.ExecuteAsync, falling back to its configured default only when the project model is null (apps/Agentweaver.Api/Blueprints/CopilotBlueprintGenerator.cs:36,:236). - Workflow generation fallback receives
workflowGenerationModelfromBlueprintService.GenerateAsyncand places it inWorkflowGenerationRequest.GenerationModelbefore invokingIWorkflowGenerator(apps/Agentweaver.Api/Blueprints/BlueprintService.cs:460,:554). - Outcome-spec drafting resolves
project.OutcomeSpecGenerationModelwhen a coordinator run activates, then carries it inCoordinatorDraftInput.OutcomeSpecGenerationModel(apps/Agentweaver.Api/Coordinator/CoordinatorRunService.cs:247,:281).
Why this hardens generation
The generation paths now preserve the model chosen for the specific project surface. Blueprint generation provider failures are returned as classified BlueprintGenerationFailureKind values with a stable ErrorCode and FailureMessage, rather than being treated as validation drift (apps/Agentweaver.Api/Blueprints/BlueprintService.cs:475, :625). The blueprint parser also preserves an empty workflows array as the explicit "no library workflow fits" signal instead of defaulting to default (apps/Agentweaver.Api/Blueprints/IBlueprintGenerator.cs:103). If fallback workflow generation is required, it uses the workflow generation model configured for the project.
Source
| Concern | File |
|---|---|
| Project fields and EF mapping | apps/Agentweaver.Api.Data/Memory/ProjectRecord.cs; MemoryDbContext.cs |
| Migration | apps/Agentweaver.Api.Migrations.Postgres/Migrations/20260708040300_AddProjectGenerationModelSettings.cs |
| Request/response DTOs | apps/Agentweaver.Api/Contracts/Dtos.cs; apps/web/src/api/types.ts |
| Settings UI | apps/web/src/pages/ProjectSettingsPage.tsx |
| Provider-settings endpoint | apps/Agentweaver.Api/Endpoints/ProjectEndpoints.cs |
| Blueprint and workflow generation use | apps/Agentweaver.Api/Endpoints/BlueprintEndpoints.cs; BlueprintService.cs; CopilotBlueprintGenerator.cs; IBlueprintGenerator.cs |
| Outcome-spec generation use | apps/Agentweaver.Api/Coordinator/CoordinatorRunService.cs; CoordinatorMessages.cs |
Visual model
Provider admission
Structured source · Editable draw.io
See also
- Project generation model settings — Reference
- Project generation model settings — Experience
- Repository blueprint suggestions
- Coordinator & orchestration
Diagram details and constraints
| Element | Contract |
|---|---|
| title | Generation preferences, not authority |
| takeaway | Three project preferences select models; execution admission separately authorizes use. |
| group-title-0 | PERSISTED SELECTION + PRECEDENCE |
| group-title-1 | FLOW CONSUMERS + AUTHORITY |
| Project settings | Project settings |
| Project settings | Blueprint · workflow · outcome spec |
| Project settings | Three nullable model preferences |
| Project settings | ProjectSettingsPage.tsx:617-648 |
| Blueprint generation | Blueprint generation |
| Blueprint generation | Resolved blueprint preference |
| Blueprint generation | Generation still requires admission |
| Blueprint generation | BlueprintEndpoints.cs:119-141 |
| Project record | Project record |
| Project record | Save nullable preference values |
| Project record | Preferences do not contain credentials |
| Project record | ProjectEndpoints.cs:815-817 |
| Fallback workflow generation | Fallback workflow generation |
| Fallback workflow generation | Resolved workflow preference |
| Fallback workflow generation | Used when no library workflow selected |
| Fallback workflow generation | BlueprintService.cs:765-773 |
| Generation model resolver | Generation model resolver |
| Generation model resolver | Project → per-flow configuration |
| Generation model resolver | Then shared generation model → default |
| Generation model resolver | GenerationModelOptions.cs:37-75 |
| Coordinator spec drafter | Coordinator spec drafter |
| Coordinator spec drafter | Resolved outcome-spec preference |
| Coordinator spec drafter | Coordinator input supplies the preference |
| Coordinator spec drafter | CopilotCoordinatorSpecDrafter:145 |
| Caller + project authority | Caller + project authority |
| Caller + project authority | Execution-plan / provider admission |
| Caller + project authority | Selection never grants credential access |
| Caller + project authority | AiExecutionPlanService.cs |
| Admitted model invocation | Admitted model invocation |
| Admitted model invocation | Authorized provider execution |
| Admitted model invocation | Selected model and admitted access differ |
| Project settings | save |
| Project record | preferences |
| Generation model resolver | model |
| Caller + project authority | authorize |
| scope | Consumer cards are separate generation flows. The authority row is not a preference inheritance step. |
| groups | PERSISTED SELECTION + PRECEDENCE; FLOW CONSUMERS + AUTHORITY |

