Skip to content

fix(install): include agent metadata config in profile installs#279

Closed
Leslie-ller wants to merge 62 commits intodarrenhinde:mainfrom
Leslie-ller:codex/fix-agent-metadata-install
Closed

fix(install): include agent metadata config in profile installs#279
Leslie-ller wants to merge 62 commits intodarrenhinde:mainfrom
Leslie-ller:codex/fix-agent-metadata-install

Conversation

@Leslie-ller
Copy link

@Leslie-ller Leslie-ller commented Mar 21, 2026

Description

This fixes the root cause behind missing agent-metadata.json in installed OAC profiles.

The repository ships .opencode/config/agent-metadata.json, but the installer did not distribute it because it was not registered as an installable config component. As a result, global/profile installs could complete without ~/.config/opencode/config/agent-metadata.json.

This PR:

  • adds agent-metadata.json to registry.json as a config component
  • includes it in all shipped profiles
  • adds installer regression coverage for both profile installs and non-interactive curl | bash style installs

Type of Change

  • Bug fix
  • New feature (agent, command, tool)
  • Documentation
  • Refactoring
  • CI/CD

Checklist

Testing

  • bash scripts/tests/test-non-interactive.sh
  • targeted install check: essential profile installs config/agent-metadata.json and includes .agents.openagent.name == "OpenAgent"
  • targeted install check: developer profile installation path includes config/agent-metadata.json (longer-running locally)
  • bash scripts/registry/validate-registry.sh -v was run locally; it emitted no component path or dependency failures in the log, but still exited non-zero in my environment

Context

This addresses the installation/distribution side of issue #277. Runtime fallback handling can remain a separate hardening change if needed.

Add ControlEvent types (10 event types), ControlEventFactory, ControlEventBus
(in-memory distribution + per-run history), and EventLog (JSONL persistence).

Instrument executor to emit structured events for run/step lifecycle,
validation results, and obligation signals. Add event-based obligation
evaluation path (evaluateControlFromEvents) alongside original step-based
path for backward compatibility.

Wire EventBus + EventLog into plugin entry point. Add 54 passing tests
covering factory, bus, log, event-based obligation evaluation, executor
event emission, and bus+log integration.
…ion of model/provider mismatches

Adds the third layer of the correction roadmap: Model Drift Audit.

- AgentStep type with model/provider expectation fields
- executeAgentStep() in executor with model audit data capture
- model.observed event emission during agent step dispatch
- evaluateModelDrift() consumes event stream for drift summary
- hasModelDrift() utility for comparison at emission site
- ModelAuditResult wired into ControlResult (audit-only: no gate impact)
- 39 passing tests in model-audit.test.ts (no regressions)
…itions

- Change TaskType and ObligationKey from closed unions to open strings
- Add ObligationDefinition interface for inline obligation declarations
- Add obligations field to Ability interface for per-ability obligation config
- Create ObligationRegistry with resolution priority: inline > runtime > built-in
- Update evaluateControl/evaluateControlFromEvents to use resolveObligations()
- Update validator: task_type is now z.string().regex, add ObligationDefinitionSchema
- Preserve backward compatibility with built-in defaults for 6 original task types
- 38 new tests passing, 0 regressions (201 pass / 21 pre-existing fail)
Phase 1 stability fix — 4 root causes addressed:
- Add skill/approval/workflow step dispatch in executor (13 failures)
- Add when-condition, on_failure:continue, output interpolation, agent context (4 failures)
- Add get()/list()/cancelActive() to ExecutionManager with history tracking (3 failures)
- Fix node→python3 in context-passing test for environment compat (1 failure)

201→274 passing tests, 0 failures.
Phase 2 — wire permission checks into step execution:
- Add checkStepPermission() with per-type permission semantics
- Pre-step permission check block in executor (opt-in model)
- Default-deny when permissions configured, approval steps always allowed
- Export new permission types from package index
- 23 unit tests + 29 integration tests for permission system

274 passing tests, 617 expect() calls.
Phase 3 — resolve plugin.ts compilation errors:
- Move class-based plugin.ts (929 lines, 20 TS errors) to _legacy/
- Update enforcement.test.ts import to point to archive location
- Canonical plugin is now opencode-plugin.ts (0 TS errors)
… and dispatcher fixes

Close the bibliography E2E loop (Batch A):

Dispatcher fixes:
- Add /bibliography plan → research/bibliography-plan routing
- Add /bibliography evidence-pack → research/section-evidence-pack routing
- Create research/bibliography-plan ability YAML

Artifact persistence (BibliographyStore):
- File-based JSON store in .opencode/bibliography-data/
- 6 artifact types: plan, screening, reading-card, decision, evidence-pack, audit
- Stage-specific queries: getScreeningByDecision, getDecisionsByVerdict
- Queue management: getReviewQueue, getDecisionQueue
- Pipeline status summary: getPipelineStatus

Pipeline orchestration (BibliographyPipeline):
- Runs single stages through the executor with automatic artifact persistence
- Loads prior-stage artifacts into stageOutputs for inter-stage data flow
- STAGE_CONFIGS maps all 6 stages to abilities, artifact types, and dependencies

Types:
- Add stageOutputs field to ExecutorContext for inter-stage data passing

Tests: 64 new tests (338 total, 791 expect() calls, 0 failures)
- bibliography-store.test.ts: 24 tests (CRUD, queries, queues, status)
- bibliography-pipeline.test.ts: 22 tests (stages, data flow, full pipeline, gates)
- bibliography-dispatch.test.ts: 18 tests (routing, meta-command, parameters)
… inputs

- Implement parseTimeout() for human-readable durations (e.g. '30s', '5m')
- Add withTimeout() Promise.race wrapper for step-level timeouts
- Implement retry logic with on_failure: 'retry' + max_retries
- Add before/after hooks execution (before=abort on fail, after=best-effort)
- Forward skill step inputs to SkillContext.load()
- Unify BaseStepFields interface across all step types (timeout, max_retries, on_failure)
- Add Ability.hooks and Ability.settings type definitions
- 27 new tests in executor-robustness.test.ts, all 365 tests pass
…n bridge

Enforce completion trust by blocking failed validation/review evidence and dependency violations from structured runtime artifacts. Add a compatible .tmp/tasks bridge and document WS3-WS5 implementation mapping so complex-path execution remains auditable and deterministic.
Derive completed/partial/blocked summaries from runtime control evidence and expose completion metadata through executor formatting, SDK, and plugin responses. Prevent optimistic done-language by surfacing remaining risks and next actions when validation or review evidence is incomplete.
darrenhinde and others added 28 commits March 18, 2026 18:11
@Leslie-ller
Copy link
Author

Superseded by a clean branch-based PR with the same change but correct ancestry. Closing this one because it was accidentally opened from a branch containing unrelated private-main history.

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.

2 participants