Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

The status_set tool previously validated message length at 40 characters via Zod schema, causing tool failures when agents provided longer messages. This changes the behavior to gracefully truncate at 60 characters with an ellipsis.

Changes:

  • Added STATUS_MESSAGE_MAX_LENGTH constant (60 chars) to toolLimits.ts
  • Removed .max(40) Zod validation from schema
  • Added truncateMessage() helper that truncates to 59 chars + "…"
  • Updated tests to verify truncation behavior

Behavior:

  • Messages ≤ 60 characters: unchanged
  • Messages > 60 characters: truncated to 59 chars + ellipsis

This eliminates validation errors for long status messages while maintaining a reasonable display limit.

Generated with cmux

- Add STATUS_MESSAGE_MAX_LENGTH constant (60 chars)
- Remove Zod max validation, add truncation logic
- Messages >60 chars truncated to 59 chars + ellipsis
- Update tests for truncation behavior

No more validation errors for long status messages.
@ammario ammario changed the title 🤖 refactor: truncate status_set messages at 60 chars instead of failing 🤖 fix: truncate status_set messages at 60 chars instead of failing Oct 29, 2025
@ammario ammario enabled auto-merge October 29, 2025 17:01
Copy link

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

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.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Codex correctly identified that the UI was reading status_set message
from tool input instead of output, bypassing truncation. Now reads
from the tool result to get the truncated message.

Added test to verify truncation propagates to UI status display.
@ammario ammario added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit dacc1df Oct 29, 2025
13 checks passed
@ammario ammario deleted the fix-status-fail branch October 29, 2025 17:30
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