Skip to content

Respect configured inbound history cap - #79148

Closed
clawsweeper[bot] wants to merge 1 commit into
release/2026.5.7from
fix-configurable-inbound-history-cap
Closed

clawsweeper[bot] wants to merge 1 commit into
release/2026.5.7from
fix-configurable-inbound-history-cap

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make inbound prompt history serialization use a caller-provided cap instead of the fixed 20-entry cap
  • pass the resolved group history limit from reply preparation, falling back to messages.groupChat.historyLimit
  • preserve Discord channel/account historyLimit through InboundHistoryLimit so prompt metadata matches the collected history window

Tests

  • pnpm test src/auto-reply/reply/inbound-meta.test.ts
  • pnpm test extensions/discord/src/monitor/message-handler.context.test.ts src/auto-reply/reply/inbound-meta.test.ts (Discord shard had no matching file; inbound-meta shard passed)
  • pnpm format:check src/auto-reply/reply/inbound-meta.ts src/auto-reply/templating.ts src/auto-reply/reply/get-reply-run.ts extensions/discord/src/monitor/message-handler.context.ts src/auto-reply/reply/inbound-meta.test.ts
  • pnpm exec tsc --noEmit --pretty false (failed: Node heap OOM at default heap)
  • NODE_OPTIONS=--max-old-space-size=8192 pnpm exec tsc --noEmit --pretty false (failed on existing PI test cast errors in src/agents/pi-embedded-runner*.test.ts; unrelated to this change)

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S labels May 8, 2026
@clawsweeper

clawsweeper Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask.

Close this PR as stalled and unproven. Its head has been unchanged since May 8, 2026, the visible proof request has been open since June 13, 2026, and it still has no after-fix runtime evidence; more importantly, the patch removes the only hard prompt-history bound and targets an inbound-context architecture that current main has since replaced.

So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again.

Review details

Best possible solution:

If maintainers still want configurable prompt-history serialization, open a fresh current-main PR that carries the resolved limit through SessionTranscriptContext, retains a documented canonical maximum, and proves both a configured value above 20 and the maximum-bound behavior in a real channel or gateway run.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: provide more than 20 inbound-history entries with a configured limit above 20 and current main serializes only the last 20. This review did not execute the runtime path because the target checkout is read-only.

Is this the best way to solve the issue?

No. The branch addresses the symptom but removes the independent untrusted-prompt bound and uses a context field superseded by current main's canonical channel ingress path.

Security review:

Security review cleared: The patch does not add a direct security or supply-chain execution path, though its removed prompt bound remains a functional merge risk.

AGENTS.md: found and applied where relevant.

What I checked:

  • Current main retains the hard prompt bound: Current main still slices inbound history to MAX_UNTRUSTED_HISTORY_ENTRIES and marks metadata as truncated above that bound, so the requested observable behavior is not implemented on main; the branch instead replaces the bound with an arbitrary configured value. (src/auto-reply/reply/inbound-meta.ts:645, c965909a30a5)
  • The PR removes the hard cap rather than preserving it: The branch changes the resolver to return any finite configured number, including very large values, then slices history by that value. This permits an unbounded amount of untrusted message history into the prompt. (src/auto-reply/reply/inbound-meta.ts:55, 4e193be9d469)
  • Current main has a canonical inbound-facts boundary: The current channel ingress helper carries transcript configuration through SessionTranscriptContext, while the old branch adds an ad-hoc InboundHistoryLimit field to the template context; the branch therefore no longer follows the current owner boundary. (src/channels/inbound-event/context.ts:501, c965909a30a5)
  • Feature-history provenance: Blame attributes the current prompt-history serialization block, including the fixed 20-entry slice, to the recent inbound-context refactor commit 67afd98fcf62d57b3af94c200dcdd8c2e0c04036; this is the current area to route any replacement work through. (src/auto-reply/reply/inbound-meta.ts:645, 67afd98fcf62)
  • Proof and inactivity gate: The PR body contains tests and typecheck attempts but no after-fix real setup output. The status: 📣 needs proof label was applied on June 13, 2026, the head commit is from May 8, 2026, and the supplied discussion contains no maintainer comment or review. (4e193be9d469)
  • Related configuration work is distinct: Merged PR fix(config): allow historyLimit: 0 in GroupChatSchema #65359 fixed validation of messages.groupChat.historyLimit: 0; it does not make prompt serialization honor values above 20, so it is adjacent rather than a replacement for this PR. (src/auto-reply/reply/inbound-meta.ts:645, 40c2d2792400)

Likely related people:

  • Peter Steinberger: Current-main blame assigns the inbound prompt-history serialization block to Peter's recent refactor commit, making him the strongest routing candidate for any current-architecture replacement. (role: recent area contributor; confidence: high; commits: 67afd98fcf62, c965909a30a5; files: src/auto-reply/reply/inbound-meta.ts, src/channels/inbound-event/context.ts)

Codex review notes: model internal, reasoning high; reviewed against c965909a30a5.

@barnacle-openclaw

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@barnacle-openclaw barnacle-openclaw Bot added the stale Marked as stale due to inactivity label May 31, 2026
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label May 31, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof.

Reviewed head: 4e193be9d469725532ce6fb10be76b0d8e47573b
Proof status: missing
Updated: 2026-07-01T11:06:51.901Z

Maintainer decision needed:

  • capture real behavior proof for this head
  • apply proof: override if the proof requirement should be waived
  • pause or close the replacement if proof should not be pursued

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. P2 Normal backlog priority with limited blast radius. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 10, 2026
@clawsweeper clawsweeper Bot added status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 18, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper applied the proposed close for this PR.

@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

🦞👀
ClawSweeper could not autoclose this item.

Reason: structured ClawSweeper close marker: close-required (sha=4e193be9d469725532ce6fb10be76b0d8e47573b)

Usage: /autoclose <maintainer close reason>. I will close this item and any open same-repo items explicitly referenced in the command text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant