Skip to content

fix(cli): wire lint into local and CI checks - #1247

Closed
lilyshen0722 wants to merge 1 commit into
fix/wrapper-refusal-deliveryfrom
fix/cli-lint
Closed

lilyshen0722 wants to merge 1 commit into
fix/wrapper-refusal-deliveryfrom
fix/cli-lint

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

No description provided.

@lilyshen0722
lilyshen0722 deleted the branch fix/wrapper-refusal-delivery August 26, 2026 07:21
lilyshen0722 added a commit that referenced this pull request Aug 26, 2026
* fix(cli): prose overflow continues in a thread — the wrapper was the one attaching

Sam (57691) asked to fold "prose overflow goes in a thread, not an attachment"
into the cue. The cue already says it, verbatim, since #1176. The behaviour he
watched all day continued anyway, and the reason is that the cue was aimed one
layer above the thing doing it: agents were not choosing to attach.

`deliverChatReply` decides the delivery mode, and its ladder ended at upload:

    fits in one message         -> post
    splits into <= maxChunks    -> post the chunks
    longer than that            -> upload the whole text as a file

Every `<agent>-reply-<eventId>.md` card in this pod came from that last rung,
including two of mine today. The function predates threads and had no concept
of one. So the cue promised a behaviour the wrapper actively contradicted —
which is @sprint-review's degrades-open caveat exactly: the cue should promise
what the kernel enforces, and here it could not be obeyed at all.

Adds the rung Sam specified — post the headline to the channel, continue the
rest under it with threadRootId — and keeps attach for the case it was always
right for: a single indivisible unit over attachThreshold (a long fence, an
unbreakable run). That is a document by construction; prose that outgrew a
message is not.

Two of this suite's existing tests caught a real bug in the first draft. The
attach rung also leads with chunks[0], so falling through after a successful
headline post duplicated the opening line in the room. The recovery now tracks
whether the headline landed: if it did, post the REMAINDER top-level
(thread-fallback) rather than the whole text again; if the headline itself
failed, nothing reached the room and attach is free to lead as before.

Two existing tests changed meaning rather than being bent to pass, and both
say so at their call site. Their fixtures are prose, which is precisely the
case this reclassifies — their INTENT (nothing is cut; flood beats truncation
or silence) is preserved and now carried by the thread.

Probe: reverting the rung reddens the six behavioural tests and leaves the
indivisible-oversize control green. Suite 61 passed.

Version 0.1.18 -> 0.1.19. Note this collides with #1215's bump if both land —
whichever merges second needs a re-bump, since the guard compares against main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(cli): resume the thread fallback from what actually posted, not from 1

`headlinePosted` was a boolean, so the recovery always resumed at
`chunks.slice(1)`. A boolean can only distinguish "nothing posted" from
"something posted"; it cannot say how much.

Fail a continuation at chunk 3 and chunks 1 and 2 are already in the thread —
the fallback then posts them again top-level, and the reader sees them twice.
That is the duplicate-opening bug this rung exists to prevent, one index
further along.

The suite did not catch it because both existing failure tests throw at the
root-id step, before any continuation has posted. At that instant "something
posted" and "one thing posted" are the same statement, which is exactly when a
boolean stands in for a count without looking wrong.

Now a counter, incremented after each successful post, with the fallback
resuming at `chunks.slice(posted)`. New test fails the 4th post and asserts
every chunk arrives exactly once; reverting to `slice(1)` reddens it alone
(1 of 62).

Found by @sprint-review gating #1217. Pushed onto this branch rather than a
second PR — the head had not moved in three hours.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(cli): record runtime post refusals

* fix(cli): wire lint into local and CI checks

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@lilyshen0722
lilyshen0722 deleted the fix/cli-lint branch August 26, 2026 07:44
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.

1 participant