mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-19 23:05:21 +00:00
* feat(plugins): append agent instructions on session open Recompute plugin instructions for each launch so changes apply on reopen without changing saved agent configuration. * test(providers): verify plugin instructions on reopen * fix(codex): refresh instructions from restored collaboration mode A resumed thread can retain its prior collaboration instructions when the mode catalog is unavailable. Rebuild those instructions from the current launch before the next turn. * fix(plugins): keep launch instructions out of agent records Provider persistence handles can contain launch configuration. Strip transient instructions before saving and projecting handles. * fix(codex): preserve built-in collaboration instructions Pass agent instructions through the thread configuration so Codex can apply its own Plan and Default mode instructions. * fix(opencode): preserve instructions when reading history History-only opens do not apply current plugin contributions, so they must not clear the native session instruction entry. * fix(codex): retain instructions after rewinding A rewind forks the native thread, which does not inherit its parent launch instructions. Pass the current instructions to the fork. * Deliver updated instructions to Codex threads * Cover Codex snapshots after rewind * Persist provider state when reopening agents * Limit resume persistence refresh to providers that need it
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
|
|
export default function contribute(server: PluginServerContext) {
|
|
server.addHook("agent.create.before", async ({ request }) => {
|
|
if (request.config.provider !== "codex") {
|
|
return request;
|
|
}
|
|
|
|
return {
|
|
...request,
|
|
config: {
|
|
...request.config,
|
|
providerOptions: {
|
|
...request.config.providerOptions,
|
|
sandbox_mode: "workspace-write",
|
|
approval_policy: "on-request",
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
server.addHook("agent.open.before", async ({ request }) => {
|
|
// Background agents are short-lived helpers; keep the company tools for the agents users open.
|
|
if (request.provider !== "codex" || request.background) {
|
|
return;
|
|
}
|
|
|
|
return {
|
|
...request,
|
|
appendSystemPrompt: [
|
|
...(request.appendSystemPrompt ?? []),
|
|
"Follow the team engineering guide.",
|
|
],
|
|
mcpServers: {
|
|
...request.mcpServers,
|
|
company: {
|
|
type: "http",
|
|
url: "https://tools.example.com/mcp",
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
return () => {};
|
|
}
|