Files
paseo/plugin-examples/agent-configuration
Mohamed Boudra 986687b8fd feat(plugins): unify lifecycle hooks and await worktree initialization (#8081)
* refactor(plugins): make lifecycle hook timing explicit

Use one registration method and subject.operation.step names so plugin authors can read whether an operation waits. Preserve old registrations through a single SDK adapter and keep timing and payloads unchanged.

* fix(plugins): align hook notes and example fixtures with release contracts

Keep the changelog inside its versioned beta entry for app parsing. Run current plugin examples against the checkout version so their declared requirements remain valid.

* docs(plugins): align translated hook dependency guidance

* fix(plugins): align hook exports and release documentation

* feat(plugins): use lifecycle positions and await worktree initialization

* test(plugins): cover first-agent worktree initialization

* test(plugins): verify rollback against workspace catalog entries
2026-10-28 17:04:52 +07:00
..

Agent configuration

Sets saved Codex options through server.addHook("agent.create.before", async ...):

  • Sets config.providerOptions.sandbox_mode to workspace-write.
  • Sets config.providerOptions.approval_policy to on-request.
  • Preserves other configuration and provider options.

Adds the company MCP server to Codex launches through server.addHook("agent.open.before", async ...). The server is never saved in the agent's configuration; existing saved MCP servers are preserved. Existing agents receive the server through the session reopen behavior.

Replace https://tools.example.com/mcp in index.server.ts with your MCP server URL before using this example. A company name collision with a saved server or another plugin fails the session open and names both sources.

Install on a daemon with plugins enabled:

paseo plugin install /absolute/path/to/plugin-examples/agent-configuration

Each session-open callback receives only this plugin's MCP servers. The nested spreads preserve entries added by this plugin's earlier callbacks. The create callback receives configuration after earlier plugins have transformed it; its explicit Codex options replace the named fields in the saved configuration of new agents and remain after this plugin is disabled.

See Inject MCP servers for choosing between saved configuration and plugin-owned servers. Lifecycle actions demonstrates provider switching and environment injection. Its provider-switch callback clears provider options when changing Codex to Claude, so use these examples separately when trying the Codex-specific settings.