fix(threads): bound a thread title at 50 characters, regenerating rather than cutting #822
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!822
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/wy58-thread-title-length"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #753, implementing the resolved design-pass spec rather than the original report.
What changed
The bound is 50.
threadTitleRunes = 50. Discord's own cap is 100 andthreadNameRunesstill holds it, but 100 does not display whole in a thread list.Over-length regenerates, it does not truncate. The second request states the limit, and
threadTitleRetryPromptbuilds that sentence from the constant so the number in the prose cannot drift from the number in the check.Exactly one regeneration. A second over-length answer is hard-trimmed and recorded as
thread.title.trimmed. A title generator must not be able to spend a turn's budget on itself.The trim is a plain cut, not
truncateRunes. That helper spends a rune on an ellipsis saying it truncated, which is the thing this bound exists to avoid.One reading of the spec worth confirming
The acceptance says to assert the bound on the creation path, not only in the generator. I took that at its word, so
threadCreationNamebounds both names a thread can get: the generated title, and the name derived mechanically from the member's own message.The derived name never went through the generator and was previously free to reach 100 runes with an ellipsis, which is the same unreadable channel-list row this issue was filed about. Bounding only the generated title would have left that standing while making the creation-path assert conditional and odd. The mutation below shows it firing on exactly that case.
If you meant the bound to apply only to model-authored titles, say so and I will narrow it.
Mutation
Trim instead of regenerate - both title tests fail, and the result is
market price comparison market price comparison ma. That is the precise shape the spec rejects, reproduced by removing the fix.Drop the creation-path bound -
TestTheCreationPathBoundsEveryThreadNamefails twice: 279 runes for the generated title, and 100 for the derived name.The retry bound is pinned by asserting the call count is exactly 2, so a loop fails as loudly as no retry does.
Acceptance
threadCreationName, mutation-checked.thread.title.trimmed.Note on failure versus over-length
A failed titling call returns empty and the caller keeps the derived name, as before. Empty is inside the bound, so a failure triggers no regeneration - only an over-length answer does. That keeps the degrade-rather-than-fail property
docs/sirens-echo-threads.mdpromises and avoids spending a second call on a backend that just errored.Verification
ward gategreen: build, policy-check, vet, test, test-skips, pre-commit. Four new tests, each run individually and each confirmed to fail under the mutations above.Reasoning:
docs/sirens-echo-thread-title-length.md.🤖 Generated with Claude Code