Skip to content

fix(agent): initialize plugins before resolving config - #25440

Closed
quangtran88 wants to merge 1 commit into
anomalyco:devfrom
quangtran88:fix/plugin-init-before-agent
Closed

fix(agent): initialize plugins before resolving config#25440
quangtran88 wants to merge 1 commit into
anomalyco:devfrom
quangtran88:fix/plugin-init-before-agent

Conversation

@quangtran88

Copy link
Copy Markdown

Summary

  • initialize plugins before Agent snapshots cfg.agent
  • align agent resolution with provider resolution and project bootstrap expectations
  • fix entry points that resolve plugin-provided default agents before full bootstrap

Closes#25438.

Why

Plugins can mutate config inside their config() hook. Agent.Service was reading config.get() before plugin initialization was guaranteed, so plugin-provided agents could be missing during early agent resolution.

Validation

  • changed file has the minimal targeted diff in packages/opencode/src/agent/agent.ts
  • package-level typecheck was attempted from packages/opencode
  • current origin/dev still has unrelated baseline typecheck failures outside this change, including:
    • ../core/src/cross-spawn-spawner.ts: encoding type mismatch
    • src/storage/db.node.ts: missing node:sqlite types in the current environment

Scope

  • packages/opencode/src/agent/agent.ts

@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label May 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 2, 2026
Sign up for freeto 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.

fix(agent): initialize plugins before resolving agent config

1 participant

@quangtran88