Skip to content

task text: one 20000-character limit, and a counter where the text is cut - #132

Merged
Lexus2016 merged 1 commit into
mainfrom
fix/task-text-limit-129
Nov 8, 2026
Merged

Lexus2016 merged 1 commit into
mainfrom
fix/task-text-limit-129

Conversation

@Lexus2016

@Lexus2016 Lexus2016 commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #129.

A task description is a prompt, and 2000 characters is shorter than a useful one. The field cut the end off with no message — once in the browser maxlength, and again in every server write — so a long prompt reached the worker with its last instructions missing.

What changed

  • One number. task-text-limit.js holds MAX_TASK_TEXT = 20000. server.js uses it in all ten task-text writes (the four task INSERTs, the update, both plan importers and the task-manager endpoint), and mcp-task-manager.js advertises the same number to the agent instead of a smaller one.
  • Both pages. public/schedule.html and public/kanban.html put the limit on every description and notes field (1 and 7 places). Each page keeps its own copy of the literal — they are single static files with no build step — and test/task-text-limit.test.js fails if a copy drifts from the module, which is what happened when the limit existed in four unrelated places.
  • A counter where the text is cut. The description in the schedule form, and the description and notes in the kanban modal, show 1234 / 20000 and turn red at the limit. A maxlength attribute truncates a paste silently; the counter is the only warning the user gets, and it reaches the limit exactly where the text was cut.
  • The schedule card shows three lines of a description instead of one (-webkit-line-clamp:3), because a longer field is only useful if some of it is visible on the board.
  • Packaging. mcp-task-manager.js is spawned as a plain node child from app.asar.unpacked, so it requires the module as ./task-text-limit.js and electron-builder.yml unpacks that file next to it — the same trap that once left bots.js inside the archive.

Deliberately not changed: the server still truncates at the limit instead of returning 400. Whether an over-long request should fail loudly is a behaviour change for API callers — today those calls lose text silently — and the reporter was asked to weigh it. This PR does the part that does not depend on that answer.

Evidence

test/task-text-limit.test.js (new, 22 checks) against the pre-change tree: 4 passed, 18 failed — a 5000-character description is stored whole — expected 5000, got 2000 on the HTTP API, on an update, and through the task-manager endpoint an agent posts to; 25000 characters capped at 2000 instead of the limit; both pages still carrying maxlength="2000". After the change: 22 passed, 0 failed.

The suite is driven the way an agent drives it: it starts a real server against a throwaway APP_DIR, posts {action, taskId, ...args} with the task-manager bearer token, and creates everything as backlog or a year out, so nothing is queued.

Three existing guards caught real mistakes in the first head, all fixed here:

  • test/env-load-order.test.js — the new local require sat above the .env loader; it moved below it.
  • test/asar-helpers.test.js and Codex's P1 — the unpacked helper would have failed with MODULE_NOT_FOUND in a packaged build; fixed by the asarUnpack entry above.
  • test/kanban-group-button.test.js — buildChainForm is rendered in a bare sandbox that now takes the limit from the page instead of a copy of the number.

Local full suite on Node 24.22.1, run suite by suite (90 suites): 89 pass, 1 skipped. test/task-backlog.test.js is the skip: it fails identically on a pristine origin/main on this machine (its second server never answers the 20 s health probe), and it passes on CI, which is where it belongs.

CI on the merged head: test (20) and test (24) both success, GitGuardian success.

Diff: 9 files, +261 / −21.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T18:14:54.999233Z a82872d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: a82872d7c1

ℹ️ 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 thread mcp-task-manager.js Outdated
const { StringDecoder } = require('string_decoder');
// Same limit the HTTP API enforces; advertising a smaller one here makes the model
// shorten a task for no reason.
const { MAX_TASK_TEXT } = require('./task-text-limit');

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 Unpack the new dependency alongside the MCP helper

In packaged Electron builds, server.js launches this helper from app.asar.unpacked using plain system Node, but electron-builder.yml only unpacks mcp-*.js, hooks/**, and bots.js. The new task-text-limit.js dependency remains inside app.asar, so this require throws MODULE_NOT_FOUND and the task-manager MCP server cannot start, removing its tools from scheduled task execution. Add task-text-limit.js to asarUnpack alongside the helper. The existing test/asar-helpers.test.js dependency-coverage check also fails on this change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 0896dca. task-text-limit.js is now listed in asarUnpack next to bots.js, the helper requires it as ./task-text-limit.js (the coverage check in test/asar-helpers.test.js resolves the extension literally), and that suite is green on the new head: 9 passed, 0 failed.

A task description is a prompt, and 2000 characters is shorter than a useful
one: the textarea and every server write cut the end off with no message, so a
long prompt reached the worker with its last instructions missing.

MAX_TASK_TEXT now lives in task-text-limit.js and is used by all ten task-text
writes in server.js, by the MCP schema an agent reads, and by the description
and notes fields in public/schedule.html and public/kanban.html. Both pages are
single static files with no build step, so each carries its own copy of the
literal and test/task-text-limit.test.js fails if a copy drifts.

mcp-task-manager.js is spawned as a plain node child from the unpacked part of
the desktop build, so it requires the module with its .js extension and
electron-builder.yml unpacks task-text-limit.js next to it - the same trap that
once left bots.js inside app.asar (test/asar-helpers.test.js pins both). The
kanban group-form test now takes the limit from the page instead of a copy.

The prose fields now show a counter that turns red at the limit - a maxlength
cut is silent otherwise - and the schedule card shows three lines of a
description instead of one.

The server still truncates at the limit rather than returning 400: failing
loudly is a behaviour change for API callers and the reporter was asked to
weigh it, so that part stays open.
@Lexus2016
Lexus2016 force-pushed the fix/task-text-limit-129 branch from a82872d to 0896dca Compare November 8, 2026 18:18
@Lexus2016
Lexus2016 merged commit 5b9638b into main Nov 8, 2026
3 checks passed
@Lexus2016
Lexus2016 deleted the fix/task-text-limit-129 branch November 8, 2026 18:26
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.

Scheduler: description field truncates long text

1 participant