Repository navigation
Closed
Description
Context
ProPR currently persists only direct coding-agent configurations. A synthetic agent must instead expose one or more virtual models whose members reference existing direct agent:model pairs. The virtual identity must remain stable everywhere users select a model, while the physical member is resolved only when an LLM call begins.
This issue establishes the configuration and API foundation. It intentionally does not implement runtime selection or retries; those are covered by the next issue.
Requirements
- Introduce shared, serializable contracts for synthetic agents, synthetic models, pool members, selection strategies, priorities, and optional session/weekly usage caps.
- Model a synthetic agent as an alias containing one or more virtual models. A member may reference only a direct agent, preventing nested pools and routing cycles.
- Treat direct and synthetic aliases as one namespace.
- Persist synthetic configuration separately from direct agents so
AgentRegistrynever attempts to create a Docker runtime for a synthetic entry. - Add authenticated configuration endpoints:
GET /api/config/synthetic-agentsPOST /api/config/synthetic-agents
- Validate aliases, default models, duplicate members, priorities, percentage limits, direct-agent references, and supported model references.
- Reject deletion of a direct agent that is still referenced by a synthetic model, while allowing a referenced direct agent to be disabled. Disabled members are handled as unavailable at runtime.
- Include enabled synthetic agents in the instance catalog so existing planner/model selectors can treat them as first-class choices.
- Preserve backward compatibility by making new catalog discriminator fields optional to older consumers.
Configuration Semantics
priorityis an integer from0through100.- The selector considers only the highest priority tier that currently contains an eligible member. This makes priority
0a natural fallback tier. - An omitted usage cap means that window does not restrict the member.
- A cap of
80means the member becomes unavailable when reported usage is greater than or equal to 80%. - Synthetic model IDs use the same durable identity rules as other public model IDs and therefore must be safe for routing and GitHub-label generation.
- Pool members store direct aliases rather than direct-agent UUIDs because aliases are already ProPR's durable routing identity. The API must prevent deleting a referenced alias.
Acceptance Criteria
- Valid synthetic configurations round-trip through the API without changing member order or defaults.
- Invalid priorities, percentages, aliases, missing defaults, duplicate member IDs, duplicate physical pairs, and references to unknown models return HTTP 400 with an actionable message.
- A synthetic alias that conflicts with a direct alias is rejected.
- Deleting a referenced direct agent returns HTTP 409 and identifies the synthetic agent/model that references it.
- Disabling a referenced direct agent remains allowed.
/api/instance/catalogreturns enabled synthetic agents withkind: "synthetic", their virtual model IDs, and their configured default model.- A synthetic model with no currently enabled valid member is omitted from the operational catalog, without deleting its saved configuration.
- Existing direct-agent configuration and catalog tests continue to pass.
- Unit tests cover schema validation, reference validation, persistence, catalog projection, and deletion protection.
Created by ProPR AI Planner
Activity
propr-dev commentedon Aug 29, 2026
Suggested Implementation:
Implementation Approach
Store synthetic agents in their own
system_configsdocument instead of extending the existingAgentConfigunion. A synthetic agent has no CLI type, image, credential path, or version, so mixing it into direct agent configuration would force synthetic-only branches into image preparation, login, health-check, and Docker code. A separate document keeps those invariants intact while still exposing pools through the shared operational catalog.A normalized virtual identity is
synthetic-agent-alias:synthetic-model-id. Pool members reference directagentAlias:modelidentities. Nested synthetic references are deliberately rejected because they complicate cycle detection, quota accounting, context guarantees, and failure reporting without adding a necessary first-version capability.Deterministic priority tiers are used instead of probabilistic weights. Weights were considered, but strict priority plus round-robin tie-breaking directly supports main/fallback configurations and is easier to explain, test, and diagnose.
File:
packages/shared/src/syntheticAgents.ts(new file)Why this file: Shared contracts are required by the backend, UI, CLI, and tests. Defining the schema once prevents each layer from interpreting percentages, defaults, or member identities differently.
File:
packages/shared/src/index.tsWhy this file: The shared package barrel is the stable import boundary used by the API, UI, and CLI. Re-exporting the contracts prevents deep imports that would become compatibility liabilities.
File:
packages/core/src/config/configManagerSyntheticAgents.ts(new file)Why this file: Core owns database-backed configuration. Keeping persistence here gives daemon, API, workers, and tests one normalized loading path while avoiding a schema migration for a JSON configuration document.
File:
packages/core/src/config/configManager.tsWhy this file: Existing callers import configuration functions through this barrel. Exporting the new manager here makes it available through
@propr/corewithout exposing the underlying config-store key.File:
packages/api/routes/configRoutesSyntheticAgents.ts(new file)Why this file: A focused handler module keeps validation and referential-integrity rules out of the already large general configuration route. The existing config router should mount these handlers under its administrator-only middleware.
File:
packages/api/routes/configRoutes.tsWhy this file: This is where the existing administrator-only configuration endpoints are assembled. Mounting the handlers here ensures synthetic credentials and routing rules inherit the same authorization and demo-mode protections as direct agents.
In the direct-agent save handler, load the current synthetic configuration before committing removals. Compare the previous and proposed direct alias sets. For every removed alias, call
findSyntheticReferencesToDirectAgent; return HTTP 409 with the referencing virtual identities when the list is non-empty. Do not apply this block when onlyenabledchanges.File:
packages/shared/src/instanceCatalog.tsWhy this file: Planner and member-facing model selectors consume this sanitized catalog. The discriminator lets newer UIs render a pool icon while optional fields preserve compatibility with older clients.
File:
packages/api/routes/instanceCatalogRoutes.tsWhy this file: This route is the operational projection used by ordinary workflows. It must expose only virtual models that have at least one currently enabled and valid direct member.
Files:
test/syntheticAgentConfig.test.tsandtest/instanceCatalogSynthetic.test.ts(new files)Why these files: Configuration is a public routing contract. Tests must pin both persisted validation and the sanitized operational projection before runtime selection is introduced.
Add table-driven tests for every acceptance criterion, including a direct-agent deletion conflict, a disabled member warning, alias collisions, malformed percentages, duplicate physical pairs, and catalog omission when all members are disabled.
propr-dev commentedon Aug 29, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol1990/gpt-5.6-sol-add-persisted-synthetic-a-20260829-2324-okp1990-epic-synthetic-pool-eusissue-1990-20260829-2324-gpt-5.6-sol-okp🔍 Track Task Execution
fix(ai): Resolve issue #1990 - Add persisted synthetic-agent and synt…
fix(ai): Resolve issue #1990 - Add persisted synthetic-agent and synt…