Skip to content

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.BlueprintGenerationModel through GenerationModelOptions.ResolveBlueprintModel, and passes it to BlueprintService.GenerateAsync (apps/Agentweaver.Api/Endpoints/BlueprintEndpoints.cs:58). CopilotBlueprintGenerator.GenerateRawAsync sends that modelId to IAgentRunner.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 workflowGenerationModel from BlueprintService.GenerateAsync and places it in WorkflowGenerationRequest.GenerationModel before invoking IWorkflowGenerator (apps/Agentweaver.Api/Blueprints/BlueprintService.cs:460, :554).
  • Outcome-spec drafting resolves project.OutcomeSpecGenerationModel when a coordinator run activates, then carries it in CoordinatorDraftInput.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 ​

ConcernFile
Project fields and EF mappingapps/Agentweaver.Api.Data/Memory/ProjectRecord.cs; MemoryDbContext.cs
Migrationapps/Agentweaver.Api.Migrations.Postgres/Migrations/20260708040300_AddProjectGenerationModelSettings.cs
Request/response DTOsapps/Agentweaver.Api/Contracts/Dtos.cs; apps/web/src/api/types.ts
Settings UIapps/web/src/pages/ProjectSettingsPage.tsx
Provider-settings endpointapps/Agentweaver.Api/Endpoints/ProjectEndpoints.cs
Blueprint and workflow generation useapps/Agentweaver.Api/Endpoints/BlueprintEndpoints.cs; BlueprintService.cs; CopilotBlueprintGenerator.cs; IBlueprintGenerator.cs
Outcome-spec generation useapps/Agentweaver.Api/Coordinator/CoordinatorRunService.cs; CoordinatorMessages.cs

Visual model ​

Provider admission ​

Guarded flow showing operation and caller authorization, provider and credential resolution, operation policy, protected execution-context acceptance, durable run-boundary capture, point-of-invocation revalidation, and explicit rejection before model calls.

Structured source · Editable draw.io

See also ​

Diagram details and constraints
ElementContract
titleGeneration preferences, not authority
takeawayThree project preferences select models; execution admission separately authorizes use.
group-title-0PERSISTED SELECTION + PRECEDENCE
group-title-1FLOW CONSUMERS + AUTHORITY
Project settingsProject settings
Project settingsBlueprint · workflow · outcome spec
Project settingsThree nullable model preferences
Project settingsProjectSettingsPage.tsx:617-648
Blueprint generationBlueprint generation
Blueprint generationResolved blueprint preference
Blueprint generationGeneration still requires admission
Blueprint generationBlueprintEndpoints.cs:119-141
Project recordProject record
Project recordSave nullable preference values
Project recordPreferences do not contain credentials
Project recordProjectEndpoints.cs:815-817
Fallback workflow generationFallback workflow generation
Fallback workflow generationResolved workflow preference
Fallback workflow generationUsed when no library workflow selected
Fallback workflow generationBlueprintService.cs:765-773
Generation model resolverGeneration model resolver
Generation model resolverProject → per-flow configuration
Generation model resolverThen shared generation model → default
Generation model resolverGenerationModelOptions.cs:37-75
Coordinator spec drafterCoordinator spec drafter
Coordinator spec drafterResolved outcome-spec preference
Coordinator spec drafterCoordinator input supplies the preference
Coordinator spec drafterCopilotCoordinatorSpecDrafter:145
Caller + project authorityCaller + project authority
Caller + project authorityExecution-plan / provider admission
Caller + project authoritySelection never grants credential access
Caller + project authorityAiExecutionPlanService.cs
Admitted model invocationAdmitted model invocation
Admitted model invocationAuthorized provider execution
Admitted model invocationSelected model and admitted access differ
Project settingssave
Project recordpreferences
Generation model resolvermodel
Caller + project authorityauthorize
scopeConsumer cards are separate generation flows. The authority row is not a preference inheritance step.
groupsPERSISTED SELECTION + PRECEDENCE; FLOW CONSUMERS + AUTHORITY