Skip to content

Raise chat.history text cap to avoid premature truncation#53243

Closed
navendugoyal19 wants to merge 2 commits into
openclaw:mainfrom
navendugoyal19:codex/fix-chat-history-truncation
Closed

Raise chat.history text cap to avoid premature truncation#53243
navendugoyal19 wants to merge 2 commits into
openclaw:mainfrom
navendugoyal19:codex/fix-chat-history-truncation

Conversation

@navendugoyal19

@navendugoyal19 navendugoyal19 commented Mar 24, 2026

Copy link
Copy Markdown

Summary

Raise the chat.history text cap from 12_000 to 64_000 and make truncation UTF-8 byte-aware so long assistant replies stay readable instead of being replaced by the oversized placeholder.

What changed

  • bumped CHAT_HISTORY_TEXT_MAX_CHARS in src/gateway/server-methods/chat.ts from 12_000 to 64_000
  • added a byte-aware fallback inside truncateChatHistoryText() so UTF-8-heavy text is truncated to a safe prefix before the 128 * 1024 single-message byte guard runs
  • added a regression test for a 50k-character ASCII assistant reply that should be preserved intact
  • added a regression test for an emoji-heavy assistant reply that should truncate visibly instead of collapsing to [chat.history omitted: message too large]

Why

Before this change, chat.history truncated content[].text, partialJson, arguments, and thinking at 12k characters before the larger byte-budget logic ran.

Raising the char cap alone fixes premature truncation for long ASCII replies, but it leaves a second failure mode: long UTF-8-heavy text can bypass the char cap and then be replaced entirely by the oversized placeholder during the later byte-budget pass.

This update fixes both paths:

  • long replies that still fit the budget remain visible
  • byte-heavy replies are truncated to a readable prefix instead of being dropped completely

Test

pnpm -C /tmp/openclaw-pr-53243 exec vitest run --config vitest.gateway.config.ts src/gateway/server.chat.gateway-server-chat-b.test.ts

Fixes #53242

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: XS labels Mar 24, 2026
@greptile-apps

greptile-apps Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR raises the per-field text truncation cap (CHAT_HISTORY_TEXT_MAX_CHARS) in chat.ts from 12_000 to 64_000 characters, and adds a regression test to confirm a 50k-character assistant message is preserved end-to-end when it fits within the existing 128 KB per-message byte budget.

  • The change correctly targets the two-layer truncation system: the per-field char cap runs first, then the per-message byte budget check runs second. At 64k chars the two layers remain consistent — a single 64k ASCII text field serializes to ~64 KB, safely under the 128 KB message cap.
  • The regression test uses __setMaxChatHistoryMessagesBytesForTest to configure the byte budget, writes a single 50k-char assistant message, and asserts it survives without truncation markers or [chat.history omitted].
  • The test hardcodes 128 * 1024 for historyMaxBytes rather than importing CHAT_HISTORY_MAX_SINGLE_MESSAGE_BYTES from the source. If that constant changes in the future the test will silently validate the wrong budget, though this is a minor maintenance concern and not a blocking issue.

Confidence Score: 5/5

  • Safe to merge — targeted single-constant change with a well-structured regression test and no risk to the byte-budget safety net.
  • The change is a one-line constant bump with clear reasoning, the existing byte-budget guard still caps oversized messages at 128 KB, and the new test validates the primary fix scenario. No logic is restructured and the risk of regression is very low.
  • No files require special attention.

Reviews (1): Last reviewed commit: "Raise chat.history text cap to avoid pre..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a974aab85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

};

const CHAT_HISTORY_TEXT_MAX_CHARS = 12_000;
const CHAT_HISTORY_TEXT_MAX_CHARS = 64_000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve non-ASCII history text before oversized fallback

Increasing CHAT_HISTORY_TEXT_MAX_CHARS to 64k allows long UTF-8-heavy text (for example CJK or emoji) to bypass truncateChatHistoryText, but those same messages can then exceed the 128 KiB per-message cap and be replaced entirely by [chat.history omitted: message too large] in the later oversized pass. That means chat.history can now drop readable long assistant replies for non-ASCII content that previously remained visible in truncated form; this affects messages roughly in the 43k–64k character range depending on byte density.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this PR to address that exact failure mode. The branch now keeps the higher 64k text cap for long ASCII replies and adds a byte-aware fallback inside truncateChatHistoryText() so UTF-8-heavy replies are truncated to a readable prefix before the oversized-message placeholder path. I also added a regression test for an emoji-heavy assistant reply to verify we no longer collapse straight to [chat.history omitted: message too large].

Address the non-ASCII chat.history regression by adding a byte-aware fallback to text truncation. Keep long UTF-8 replies readable instead of replacing them with the oversized placeholder, and cover the behavior with a regression test for emoji-heavy assistant text.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df04b818de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +425 to +427
if (Buffer.byteLength(next, "utf8") > CHAT_HISTORY_TEXT_MAX_BYTES) {
const suffixBytes = Buffer.byteLength(CHAT_HISTORY_TRUNCATED_SUFFIX, "utf8");
const maxPrefixBytes = Math.max(0, CHAT_HISTORY_TEXT_MAX_BYTES - suffixBytes);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Measure history text budget with JSON-encoded bytes

The new truncation logic budgets text with Buffer.byteLength(..., "utf8"), but the later oversize gate uses full JSON.stringify bytes, so escape-heavy text can still be replaced by [chat.history omitted: message too large] even when it could have been preserved by truncation. For example, a long assistant message containing many ", \\, or control characters can stay under CHAT_HISTORY_TEXT_MAX_BYTES here but exceed CHAT_HISTORY_MAX_SINGLE_MESSAGE_BYTES after JSON escaping, causing a full placeholder fallback (a regression from the previous much lower 12k cap).

Useful? React with 👍 / 👎.

@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.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 29, 2026
@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-22 14:16 UTC / May 22, 2026, 10:16 AM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
The branch raises the chat.history text cap to 64,000, adds raw UTF-8 byte-aware truncation, and adds gateway tests for long ASCII and emoji-heavy assistant history text.

Reproducibility: yes. Source inspection and byte math show that current main can truncate a 50k ASCII assistant message before the 128 KiB serialized single-message cap, and the Control UI path can force an even lower 4,000-character cap.

PR rating
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Summary: The PR targets a real bug, but missing real behavior proof plus blocking truncation/path defects make it not quality-ready.

Rank-up moves:

  • Add redacted real behavior proof showing after-fix chat.history or WebChat output for a long assistant reply.
  • Rework the implementation onto src/gateway/chat-display-projection.ts and budget truncation against serialized message bytes.
  • Align or justify the Control UI maxChars policy so the common WebChat history path is covered.
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Real behavior proof
Needs real behavior proof before merge: No after-fix real Gateway/WebChat or chat.history output proof is present; the PR body and comments only provide a test command and discussion. After adding redacted proof, updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A real WebChat proof would directly show whether a long history reload remains readable instead of ending at a truncation marker. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify WebChat history reload keeps a long assistant message readable and include redacted chat.history output.

Risk before merge

  • The branch targets an older server-methods truncation helper while current main routes chat display truncation through src/gateway/chat-display-projection.ts.
  • The raw UTF-8 fallback can still allow JSON-escape-heavy text to exceed the serialized single-message hard cap and collapse to the oversized placeholder.
  • Raising the direct chat.history default changes payload-size behavior for existing direct RPC callers and needs an explicit maintainer cap-policy decision.
  • Normal Control UI/WebChat history still sends maxChars: 4000, so the common user-visible path can remain truncated even if the gateway default is raised.
  • No after-fix real Gateway/WebChat or chat.history output proof is present for this external PR.

Maintainer options:

  1. Rework projection and UI policy first (recommended)
    Move the fix to the shared projection helper, budget prefixes against serialized message bytes, and settle the Control UI request cap before merge.
  2. Accept a larger direct-RPC default explicitly
    Maintainers could choose the larger default as intentional, but should pair it with upgrade/performance proof and a clear WebChat cap policy.
  3. Replace the stale branch
    If rebasing this branch is not worth the churn, keep the canonical issue open and use a narrow replacement PR on current main.

Next step before merge
Needs maintainer cap-policy/rebase review and contributor real behavior proof; automation cannot supply the missing contributor setup proof or choose the durable WebChat policy.

Security
Cleared: The diff only changes Gateway chat-history truncation logic and Gateway tests; no concrete security or supply-chain concern was found.

Review findings

  • [P2] Measure truncation against serialized message bytes — src/gateway/server-methods/chat.ts:425-427
  • [P2] Cover the current WebChat history path — src/gateway/server-methods/chat.ts:96
Review details

Best possible solution:

Rebase or replace the branch on current main by moving serialized-byte-aware truncation into src/gateway/chat-display-projection.ts, aligning Control UI maxChars/config/default policy, and proving the Gateway plus WebChat history behavior.

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

Yes. Source inspection and byte math show that current main can truncate a 50k ASCII assistant message before the 128 KiB serialized single-message cap, and the Control UI path can force an even lower 4,000-character cap.

Is this the best way to solve the issue?

No. The PR is not the best complete fix because it targets an older helper, budgets raw text bytes instead of serialized message bytes, and does not settle the Control UI/config cap policy.

Label justifications:

  • P2: This is a normal-priority Gateway/WebChat history truncation fix with clear user-visible message-loss impact and limited blast radius.
  • merge-risk: 🚨 compatibility: The PR changes default chat.history text limits and payload-size behavior for existing direct RPC callers.
  • merge-risk: 🚨 message-delivery: The patch changes history truncation behavior and can still omit readable assistant text for JSON-escape-heavy messages.
  • rating: 🧂 unranked krab: Current PR rating is 🧂 unranked krab because proof is 🧂 unranked krab, patch quality is 🧂 unranked krab, and The PR targets a real bug, but missing real behavior proof plus blocking truncation/path defects make it not quality-ready.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix real Gateway/WebChat or chat.history output proof is present; the PR body and comments only provide a test command and discussion. After adding redacted proof, updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Full review comments:

  • [P2] Measure truncation against serialized message bytes — src/gateway/server-methods/chat.ts:425-427
    The fallback trims candidates with raw Buffer.byteLength(candidate, "utf8"), but the later oversized gate measures the JSON-serialized message. Control-character-heavy text can stay under this raw budget, serialize past the 128 KiB single-message cap, and still be replaced entirely by the placeholder, so the prefix budget needs to account for serialized history bytes.
    Confidence: 0.93
  • [P2] Cover the current WebChat history path — src/gateway/server-methods/chat.ts:96
    Raising this server-side default does not fix normal WebChat history reloads while Control UI sends maxChars: 4000, and current main now owns display truncation in src/gateway/chat-display-projection.ts. Rework the patch onto the shared projection/request path so the user-facing WebChat history bug is actually covered.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.9

What I checked:

Likely related people:

  • steipete: Authored and committed the helper that now owns chat display projection and truncation behavior. (role: introduced current projection path; confidence: high; commits: 5f2273e81efc; files: src/gateway/chat-display-projection.ts, src/gateway/server-methods/chat.ts, src/gateway/session-history-state.ts)
  • ImLukeF: Authored the merged configurable chat.history maxChars work and tests on the same gateway/config surface. (role: introduced related configurable limit; confidence: high; commits: 1654c3a85137; files: src/gateway/server-methods/chat.ts, src/gateway/server.chat.gateway-server-chat-b.test.ts, src/config/zod-schema.ts)
  • BunsDev: Recently updated mixed assistant history projection and Control UI history-load behavior near this truncation path. (role: recent adjacent contributor; confidence: medium; commits: 3110c621df14, 60171e863882; files: src/gateway/chat-display-projection.ts, src/gateway/server.chat.gateway-server-chat-b.test.ts, ui/src/ui/controllers/chat.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 29118a0f0f0b.

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge.

What this changes:

This PR raises the old chat.history text cap to 64,000, adds raw UTF-8 byte-aware truncation before the oversized-message placeholder, and adds gateway regression tests for long ASCII and emoji-heavy assistant text.

Maintainer follow-up before merge:

An open contributor PR already exists and is paired with #53242, but it needs maintainer review/rebase because current main moved the relevant behavior into the shared projection helper and the branch still has a serialized-byte budgeting defect.

Review findings:

  • [P2] Measure truncation against serialized history bytes — src/gateway/server-methods/chat.ts:425-427
Review details

Best possible solution:

Implement the behavior in src/gateway/chat-display-projection.ts, preserve long assistant text that fits the serialized history budget, truncate byte-heavy or JSON-escape-heavy text to a visible prefix before placeholder replacement, and align the chosen default/config documentation with focused gateway and UI history coverage.

Full review comments:

  • [P2] Measure truncation against serialized history bytes — src/gateway/server-methods/chat.ts:425-427
    The fallback trims candidates with Buffer.byteLength(candidate, "utf8"), but the later oversized gate measures JSON.stringify(message). Escape-heavy text such as control characters can stay under this raw text budget, expand past the 128 KiB single-message cap when serialized, and still be replaced entirely by the placeholder. Budget the prefix against the JSON-encoded message/string bytes so these messages degrade to visible truncation instead of omission.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.87

Acceptance criteria:

  • pnpm test src/gateway/server.chat.gateway-server-chat-b.test.ts src/gateway/server-methods/server-methods.test.ts
  • pnpm test ui/src/ui/controllers/chat.test.ts
  • pnpm exec oxfmt --check --threads=1 src/gateway/chat-display-projection.ts src/gateway/server-methods/chat.ts src/gateway/server.chat.gateway-server-chat-b.test.ts ui/src/ui/controllers/chat.ts

What I checked:

  • Current default projection still truncates by character count: Current main defines DEFAULT_CHAT_HISTORY_TEXT_MAX_CHARS as 8,000 and truncateChatHistoryText slices by character count before appending the truncation suffix; there is no byte-aware prefix fallback in the shared projection helper. (src/gateway/chat-display-projection.ts:11, e46dccb35374)
  • chat.history applies projection before the serialized byte cap: chat.history resolves the effective max chars, calls projectRecentChatDisplayMessages, then runs replaceOversizedChatHistoryMessages; the oversized gate measures jsonUtf8Bytes(message), so byte-heavy or JSON-escape-heavy text can still collapse to the placeholder after projection. (src/gateway/server-methods/chat.ts:1676, e46dccb35374)
  • Control UI uses the default/config path: loadChatHistory sends chat.history with sessionKey and limit only, so ordinary Control UI/WebChat history still depends on the gateway default or config rather than a per-request 64,000-character override. (ui/src/ui/controllers/chat.ts:402, e46dccb35374)
  • Related configurable-limit work does not supersede this PR: Merged feat(gateway): make chat history max chars configurable #58900 made chat.history max text truncation configurable via gateway.webchat.chatHistoryMaxChars and per-request maxChars, while preserving existing default payload limits; it did not implement the requested default increase or serialized-byte-aware fallback. (CHANGELOG.md:3068, e46dccb35374)
  • Current tests cover config and placeholders, not the PR regressions: Existing gateway tests cover gateway.webchat.chatHistoryMaxChars, RPC maxChars, and hard oversized placeholders, but no current-main test preserves a 50k ASCII assistant message or verifies visible truncation for emoji/control-heavy text before placeholder replacement. (src/gateway/server.chat.gateway-server-chat-b.test.ts:688, e46dccb35374)
  • PR diff and security pass: The PR diff touches only src/gateway/server-methods/chat.ts and src/gateway/server.chat.gateway-server-chat-b.test.ts; it does not change workflows, dependencies, lockfiles, package metadata, install/build/release scripts, or secret-handling paths. The functional risk is the changed truncation logic, not supply-chain surface. (src/gateway/server-methods/chat.ts:425, df04b818de86)

Likely related people:

  • steipete: Introduced the shared chat display projection helper and recently maintained adjacent chat-history/server flow, including current projection and TUI history startup work. (role: recent maintainer and adjacent owner; confidence: high; commits: 5f2273e81efc, 7e41913a203a; files: src/gateway/chat-display-projection.ts, src/gateway/server-methods/chat.ts, src/gateway/server.chat.gateway-server-chat-b.test.ts)
  • ImLukeF: Merged feat(gateway): make chat history max chars configurable #58900, which added gateway.webchat.chatHistoryMaxChars, per-request maxChars, schema/protocol updates, and gateway tests on the same chat-history truncation surface. (role: introduced related configurable limit; confidence: high; commits: 1654c3a85137; files: src/gateway/server-methods/chat.ts, src/gateway/server.chat.gateway-server-chat-b.test.ts, src/config/types.gateway.ts)

Remaining risk / open question:

  • The PR branch targets the older src/gateway/server-methods/chat.ts truncation helper, while current main routes display normalization through src/gateway/chat-display-projection.ts.
  • The proposed byte-aware fallback budgets raw UTF-8 text bytes, but the hard replacement gate budgets the full JSON-serialized message, so escape-heavy text can still be omitted entirely.
  • No tests were executed during this read-only sweep; the verdict is based on source, diff, docs, test, and history inspection.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374.

@toruvieI

Copy link
Copy Markdown
Contributor

Thanks for pointing this here. If I'm reading the proposed 64k cap correctly, it may look excessive at first glance, but the current practical behavior is much worse: Control UI/WebChat currently sends chat.history with a hardcoded maxChars: 4000, and that causes frequent visible truncation with ...(truncated)... and no continuation.

That is effectively message loss in WebChat, not just cosmetic clipping: #P2 #impact:message-loss. It also makes WebChat much harder to use for the exact case where people choose it over Telegram/mobile channels: reading larger answers, reports, summaries, logs, and debugging output on a bigger screen.

@clawsweeper could you please take a look at #83151 and move any relevant labels/priority here if this PR is the canonical fix path? This bug is very painful in day-to-day WebChat usage.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 19, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@steipete

Copy link
Copy Markdown
Contributor

Thanks @navendugoyal19. Closing this as superseded by the current WebChat history direction on main.

The branch tries to raise the default chat.history inline text cap and add UTF-8 truncation in the older server-methods path. Current main moved the contract instead: chat.history remains bounded, API clients can still send per-request maxChars, and Control UI opens truncated visible assistant messages through chat.message.get for the full display-normalized entry.

Relevant current-main commits:

  • d07f508020270d0262de358f3c01bdacf8d975d7 removed the Control UI maxChars: 4000 request cap.
  • 199a1b901400a3f912fbb69e4fa5f7f4becc1843 added the full-message side reader.
  • d1b514af2e2cc1e66acaf9179213f1c5c09d70f5 retired persisted WebChat config.

git merge-tree also shows this branch now conflicts in src/gateway/server-methods/chat.ts and src/gateway/server.chat.gateway-server-chat-b.test.ts, so it is not a good rebase candidate.

Proof on current main at 0ee5f47fbabb:

node scripts/run-vitest.mjs src/gateway/server.chat.gateway-server-chat-b.test.ts ui/src/ui/app-sidebar-full-message.test.ts ui/src/ui/chat/grouped-render.test.ts ui/src/ui/controllers/chat.test.ts

Result: passed 3 Vitest shards, 156 tests total.

Appreciate the clear report and tests. The old default-cap increase is not planned now that WebChat has the bounded-history plus full-message-reader path.

@steipete steipete closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: chat.history truncates long assistant messages at 12k chars even when they fit the history budget

3 participants