Skip to content

feat(runner): inline raw event payload into agent prompt - #84

Merged
DominikPinsel merged 1 commit into
mainfrom
feat/event-data-payload
Aug 12, 2026
Merged

feat(runner): inline raw event payload into agent prompt#84
DominikPinsel merged 1 commit into
mainfrom
feat/event-data-payload

Conversation

@DominikPinsel

Copy link
Copy Markdown
Owner

Summary

The runner only prompted agents with a minimal <event> summary block:

<event>
  type: issue_comment.created
  org: DominikPinsel
  repo: DominikPinsel/ainsel
  issue: 83
  actor: DominikPinsel
  event_id: evt_...
</event>

even though the hub already delivered the full webhook payload in task.payload. Comment bodies, issue titles/bodies and all other event details never reached the model, so e.g. a @review-agent wdyt? mention left the agent blind to what it was supposed to review.

Changes

  • buildUserMessage now appends the raw payload as a pretty-printed <event-data> JSON block after the event summary
  • Capped via new EVENT_DATA_MAX_CHARS env (default 16,000 chars), truncated head+tail with the existing truncateWithMarker
  • Added EVENT_DATA_MAX_CHARS to the transcript-redaction denylist (non-sensitive config)
  • Chat/cron branches unchanged — they already carry their content inline

Notes

No payload filtering: whatever the webhook delivered is inlined (subject to the char cap). Payload content goes into the prompt, not the transcript store.

Test plan

  • npm test in pi/pi-extensions/ainsel-runner — 83/83 pass (10 new tests: payload inlining, null/chat omission, truncation marker, resolveEventDataMaxChars default/invalid/valid)
  • Deploy runner, comment @agent on a PR, verify the prompt contains the full event JSON

The runner delivered only a minimal <event> summary block (type, org,
repo, issue/pr number, actor) to the agent, discarding the full webhook
payload that the hub already delivered in task.payload. Agents had no
way to see comment bodies, issue titles or other event details without
guessing tool calls.

Append the raw payload as an <event-data> JSON block after the event
summary, capped by EVENT_DATA_MAX_CHARS (default 16000 chars) using the
existing head+tail truncateWithMarker.
@DominikPinsel
DominikPinsel merged commit 1464b27 into main Aug 12, 2026
3 checks passed
@DominikPinsel
DominikPinsel deleted the feat/event-data-payload branch August 12, 2026 15:35
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