Skip to content

Auto-bootstrap prompt agents in empty Foundry projects#188

Merged
placerda merged 1 commit into
developfrom
feature/prompt-agent-bootstrap
May 29, 2026
Merged

Auto-bootstrap prompt agents in empty Foundry projects#188
placerda merged 1 commit into
developfrom
feature/prompt-agent-bootstrap

Conversation

@placerda
Copy link
Copy Markdown
Contributor

Summary

Adds an optional prompt_agent_bootstrap block to �gentops.yaml. When the prompt-agent deploy workflow runs against a dev / qa / prod Foundry project that does not yet contain the seed agent, it reads that block plus prompt_file and creates the first version automatically (recorded as action: ""bootstrapped"" in oundry-agent.json).

This eliminates the previous per-environment manual seeding step that forced operators to recreate the same prompt agent in every Foundry project before CI could promote prompts to it.

Why

The current prompt-agent quickstart asked the user to manually create travel-agent:1 in two Foundry projects (sandbox + dev). PO feedback: Não faz sentido. Eu deveria criar apenas no sandbox; o dev deve sempre atualizar com pipeline de continuous deployment. This change makes sandbox-only seeding the supported path.

Scope

Code:

  • core/agentops_config.py – PromptAgentBootstrap Pydantic model (required model; optional description, model_parameters, ools) + prompt_agent_bootstrap field on AgentOpsConfig.
  • pipeline/prompt_deploy.py – stage_prompt_agent_candidate now branches on 404 lookup; new _bootstrap_prompt_agent and strict _is_not_found_error helpers. New action: ""bootstrapped"".
  • services/workflow_analysis.py – emits prompt_agent_bootstrap_missing warning when prompt-agent mode lacks the block.
  • emplates/agentops.yaml – commented bootstrap example.

Docs:

  • utorial-prompt-agent-quickstart.md – sandbox-only seeding (section 4), updated yaml example + bootstrap callout + project_endpoint warning (section 9), stage-on-empty flow (section 11), action: bootstrapped first-deploy artifact (section 13).
  • utorial-end-to-end.md – multi-env bootstrap callout pointing to the prompt-agent quickstart.
  • �gentops-config and �gentops-workflow SKILL.md – documented the new block and the bootstrap-on-empty branch.
  • CHANGELOG.md Unreleased – Added entry.

Tests (16 new):

  • est_prompt_deploy.py – bootstrap path, missing config raises, auth errors propagate, ignores bootstrap when seed exists, sanity check on _is_not_found_error.
  • est_agentops_config.py – schema validation (default None, model-only, full payload, empty-model rejected, unknown fields rejected).
  • est_workflow_analysis.py – warning fires when bootstrap missing, silent when present.

Full suite: 784 passed, 3 skipped.

Safety

  • 401 / 403 and other non-404 errors continue to propagate. The bootstrap path only triggers on a genuine agent does not exist 404. Test test_stage_prompt_agent_propagates_auth_errors confirms.
  • prompt_agent_bootstrap is optional. Existing configs that don't set it keep the old behavior: the stage step raises on 404 with the original error.
  • Schema is additive; no breaking change to agentops.yaml.

Rubber-duck review

Pre-implementation critique surfaced several blind spots that shaped the final design:

  • Field name (prompt_agent_bootstrap over prompt_agent_defaults) to communicate one-time semantics.
  • Strict 404 detection so RBAC issues never get masked.
  • project_endpoint precedence warning in the tutorial (yaml wins over env, breaks multi-env).
  • Required description for workflow analyze warning so users learn about the block before hitting CI.

Adds an optional `prompt_agent_bootstrap` block to `agentops.yaml`
that lets the prompt-agent deploy workflow create the first version of
an agent in a dev / qa / prod Foundry project that does not yet contain
one. When the stage step looks up the seed agent and gets a 404, it
reads the model deployment (required) plus optional description,
model_parameters, and tools from prompt_agent_bootstrap, combines them
with prompt_file, and creates the first version automatically.

The deployment artifact records the new `action: bootstrapped` for
that first run; subsequent deploys follow the normal reuse /
next-version flow.

This eliminates the previous per-environment manual seeding step that
forced users to recreate the same prompt agent in every Foundry
project before CI could promote prompts to it. The first PR / deploy
into an empty dev project now succeeds out of the box; only the
sandbox project needs a manual seed (so authors still have a playground
to iterate in).

Authentication (401 / 403) and other non-404 errors continue to
propagate — the bootstrap path only triggers on a genuine `agent does
not exist` 404 via a strict _is_not_found_error helper.

`agentops workflow analyze` now emits a warning when a prompt-agent
workspace is missing prompt_agent_bootstrap to surface the recommended
configuration before operators hit it in CI.

Documentation:
- tutorial-prompt-agent-quickstart.md: rewrote section 4 (sandbox-only
  seed), section 9 (yaml example + bootstrap callout +
  project_endpoint warning), section 11 (stage-on-empty flow), and
  section 13 (action: bootstrapped on first deploy artifact).
- tutorial-end-to-end.md: added a multi-env bootstrap callout pointing
  at the prompt-agent quickstart for the full journey.
- agentops-config skill: documented the new optional block.
- agentops-workflow skill: documented the bootstrap-on-empty branch.
- CHANGELOG Unreleased: Added entry under Added.

Tests: 16 new unit tests across test_prompt_deploy.py (bootstrap path,
missing config raises, auth errors propagate, ignores bootstrap when
seed exists), test_agentops_config.py (schema validation), and
test_workflow_analysis.py (missing-bootstrap warning, silent when
present). Full suite: 784 passed, 3 skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@placerda placerda merged commit f41fe7c into develop May 29, 2026
12 checks passed
@placerda placerda deleted the feature/prompt-agent-bootstrap branch May 29, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant