Skip to content

feat(logging): bump CHAT_LOG_ARRAY_TAIL_ITEMS default 24 -> 128 - #9735

Closed
hartmark wants to merge 2 commits into
cheaper-inference:release/v3.8.50from
hartmark:feat/chat-log-array-tail-items
Closed

hartmark wants to merge 2 commits into
cheaper-inference:release/v3.8.50from
hartmark:feat/chat-log-array-tail-items

Conversation

@hartmark

@hartmark hartmark commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Real agentic CLIs with many MCP servers routinely declare 40-50+ tools in a single request — a live OpenClaw session logged 47. The tail-24 default silently dropped the array's earlier entries behind an _omniroute_truncated_array marker, so investigating why a specific tool call (apply_patch) behaved oddly turned up nothing: its declared shape (function vs custom type) was unrecoverable from the call log across 40 recent requests, even though the calls themselves succeeded.

Bumped the configurable default to comfortably cover real large tool lists with headroom. Updated .env.example and docs/reference/ENVIRONMENT.md to match (env-doc-sync check passes).

⚠️ base-red inherited: #9737

Test plan

  • TDD: new tests/unit/chat-log-array-tail-items-default.test.ts pins the literal default (24 -> 128) — confirmed failing on a clean release/v3.8.50 checkout, passing after. (The original commit had no dedicated test; the pre-existing chatcore-log-truncation.test.ts derives its own expectations from getChatLogArrayTailItems() so it can't discriminate this specific regression.)
  • npm run typecheck:core — clean
  • npm run lint — clean
  • npm run check:file-size — clean

@hartmark
hartmark requested a review from diegosouzapw as a code owner August 7, 2026 21:30
@hartmark
hartmark force-pushed the feat/chat-log-array-tail-items branch from b09de9e to 5a2947e Compare August 8, 2026 11:41
Real agentic CLIs with many MCP servers routinely declare 40-50+ tools in
a single request — a live OpenClaw session logged 47. The tail-24 default
silently dropped the array's earlier entries behind an
_omniroute_truncated_array marker, so investigating why a specific tool
call (apply_patch) behaved oddly turned up nothing: its declared shape
(function vs custom type) was unrecoverable from the call log across 40
recent requests, even though the calls themselves succeeded.

Bumped the configurable default to comfortably cover real large tool
lists with headroom. Updated .env.example and docs/reference/
ENVIRONMENT.md to match (env-doc-sync check passes).
The bump commit had no dedicated test asserting the literal default
value; the existing chatcore-log-truncation.test.ts derives its
expectations from getChatLogArrayTailItems() itself, so it can't
discriminate a regression back toward the old, too-small 24 default.
@hartmark
hartmark force-pushed the feat/chat-log-array-tail-items branch from 5a2947e to a7891dc Compare August 8, 2026 13:59
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

2 similar comments
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Obrigado pelo PR. Mantive a revisão de fix-in-place e não foi possível concluir o ajuste completo aqui:

  • Para os PRs em fork: não consigo aplicar push de correção diretamente na sua branch.
    Por favor, faça um rebase/sync com release/v3.8.50, resolva conflitos se houver, e rode os checks dessa branch.
    Se preferir, posso aplicar a correção na próxima rodada assim que você mandar o branch atualizado ou confirmar que o PR está limpo pra esse merge.

@hartmark

hartmark commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Code landed in #9864

@hartmark hartmark closed this Aug 9, 2026
@hartmark
hartmark deleted the feat/chat-log-array-tail-items branch August 9, 2026 18:17
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.

2 participants