Skip to content

feat: configurable canvas context truncation limits#20

Merged
charlesrhoward merged 2 commits intomainfrom
codex/issue-11-configurable-canvas-serialization
Feb 15, 2026
Merged

feat: configurable canvas context truncation limits#20
charlesrhoward merged 2 commits intomainfrom
codex/issue-11-configurable-canvas-serialization

Conversation

@charlesrhoward
Copy link
Contributor

@charlesrhoward charlesrhoward commented Feb 15, 2026

Summary

  • add configurable context truncation options to canvas state serializer
  • support first/last truncation strategy with per-call overrides
  • add env-backed defaults via AI_CHAT_CONTEXT_MAX_NODES and AI_CHAT_CONTEXT_MAX_EDGES

Fixes #11


Note

Low Risk
Small, isolated change to how AI canvas context strings are truncated; main risk is unexpected context ordering/size if env vars or options are misconfigured.

Overview
Makes createCanvasContextString truncation configurable instead of hardcoded, adding per-call CanvasContextOptions (maxNodes, maxEdges, truncationStrategy of first/last).

Adds env-backed defaults via AI_CHAT_CONTEXT_MAX_NODES and AI_CHAT_CONTEXT_MAX_EDGES, validates/sanitizes limits, and updates the truncation note to reflect actual limits and strategy used.

Written by Cursor Bugbot for commit 175e620. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawit Ready Ready Preview, Comment Feb 15, 2026 8:06pm

Request Review

@charlesrhoward charlesrhoward merged commit f7b79ad into main Feb 15, 2026
4 checks passed
@charlesrhoward charlesrhoward deleted the codex/issue-11-configurable-canvas-serialization branch February 15, 2026 20:07
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.

Make canvas serializer truncation strategy configurable

1 participant

Comments