Skip to content

feat: experimental.chat.system.transform: add agent name as input argument#32474

Open
jpetrina wants to merge 1 commit into
anomalyco:devfrom
jpetrina:jpetrina/ecst-agent-name
Open

feat: experimental.chat.system.transform: add agent name as input argument#32474
jpetrina wants to merge 1 commit into
anomalyco:devfrom
jpetrina:jpetrina/ecst-agent-name

Conversation

@jpetrina

@jpetrina jpetrina commented Jun 15, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This change transforms this:

"experimental.chat.system.transform": async (input, output) => {
  console.log("session, system", input.sessionID, output.system);
},

into supporting this:

"experimental.chat.system.transform": async (input, output) => {
  if (input.agent === 'title') return output;
  console.log("session, agent, system", input.sessionID, input.agent, output.system);
},

How did you verify your code works?

Built on Arch Linux and modified DietrichGebert/ponytail like this:

diff --git a/.opencode/plugins/ponytail.mjs b/.opencode/plugins/ponytail.mjs
index 2fd3625..f8a0f1f 100644
--- a/.opencode/plugins/ponytail.mjs
+++ b/.opencode/plugins/ponytail.mjs
@@ -46,7 +46,13 @@ export default async ({ client } = {}) => {
     // Append the ruleset to the system prompt every turn.
     'experimental.chat.system.transform': async (_input, output) => {
       const mode = readMode();
-      if (mode === 'off') return;
+      // Avoid injecting ourselves into OpenCode title generation
+      if (mode === 'off' || _input.agent === 'title') return output;
       output.system.push(getPonytailInstructions(mode));
     },

OpenCode uses a title agent with a system message You are a title generator. You output ONLY a thread title. Nothing else. .... However, when a very small agent is used (like smollm2-135M-it) the additional system prompt injected by the ponytail plugin proves too much for the model to handle.

This change allows the plugin to filter out title agent requests and not inject system message for that puprpose — it is likely not intended to be used that way anyway.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title Add agent name as input parameter to experimental.chat.system.transform doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

…ument

This change transforms this:

```
"experimental.chat.system.transform": async (input, output) => {
  console.log("session, system", input.sessionID, output.system);
},
```

into supporting this:

```
"experimental.chat.system.transform": async (input, output) => {
  if (input.agent === 'title') return output;
  console.log("session, agent, system", input.sessionID, input.agent, output.system);
},
```

Signed-off-by: Jakov Petrina <jkv.petrina@gmail.com>
@jpetrina jpetrina force-pushed the jpetrina/ecst-agent-name branch from 18779d8 to c7b94f7 Compare June 15, 2026 20:20
@jpetrina jpetrina changed the title Add agent name as input parameter to experimental.chat.system.transform feat: experimental.chat.system.transform: add agent name as input argument Jun 15, 2026
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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