Skip to content

fix(agents): make the resync topic list honest about its cap - #258

Open
bniladridas wants to merge 2 commits into
Vycari:mainfrom
bniladridas:issue-253-resync-topic-cap
Open

bniladridas wants to merge 2 commits into
Vycari:mainfrom
bniladridas:issue-253-resync-topic-cap

Conversation

@bniladridas

@bniladridas bniladridas commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Human overview

A resync notice tells the agent which topics to catch up on, but it lists at most 40 and used to append "and N more" while also saying each topic came with its room_id and topic_id. Past 40 the notice now states how many of the total it lists and points at topics_list for the rest, and topics_list now takes archived, because the notice counts archived topics that the tool's default view folds. Fixes #253, part of #122; this PR does not finish #122.

AI reviewer

Details for agents: what the diff does, invariants, verification, checklist

What the diff does

  • ChannelWorker._flush_resync keeps the first 40 topics and their existing per-topic format, but replaces the ; and N more suffix with ; this lists the first 40 of N, so call topics_list with archived=true for the rest when len(known) > _RESYNC_TOPICS_SHOWN.
  • topics_list gains an optional boolean archived, mirroring pepper topics list --archived. The default fold is unchanged: an archived topic is left out unless it is the room's default.
  • _RESYNC_TOPICS_SHOWN's comment now separates the cause cap, which still says "and N more", from the topic cap, which points at the tool.
  • INSTRUCTIONS, planning/claude-code-channel.md and src/pepper_cli/data/agent-skill/SKILL.md no longer claim the notice or the default tool lists every topic.
  • tests/test_claude_channel.py updates the resync test to 45 topics whose omitted five are archived non-default topics, adds test_topics_list_can_include_archived_topics_on_request, and pins the tool schema's archived property.

Invariants

  • The 40-topic cap, the 5-cause cap, and resync coalescing are unchanged.
  • The resync count still includes archived topics. The startup map deliberately keeps them, and catch-up is meant to cover them; the omitted rows are reachable now because the pointer asks the tool to include them.
  • A default topics_list call returns exactly what it did before: archived topics folded except a room's default.
  • Every listed topic still carries its room_id and topic_id, and the untruncated notice path is unchanged.

Alternatives rejected

  • Excluding archived topics from the count: it would hide known topics that the recovery path exists to cover, and it changes what the notice says the channel knows.
  • Including archived topics in the default topics_list: that would stop matching pepper topics list's fold and offer archived topics as ordinary places to post.
  • Keeping ; and N more alone: it made a truncated list read as complete.

Where to look hardest

  • The pointer must keep archived=true; the new resync test puts every omitted row in the archived set, so dropping the flag or reverting to the old wording fails.
  • args.get("archived") is True accepts only a JSON boolean, matching the schema; a truthy non-boolean such as the string "false" does not flip the fold.
  • The condition is strict > 40; exactly 40 topics must render no pointer and no archived=true advice.

Failure posture

If this is wrong, an agent in a large workspace can still infer the list is complete, or can be sent to a tool view that hides the very archived topics it omitted. The tests pin the count, the pointer, the flag, topic 40's absence, and the default fold.

Verification

Run on the branch head 597817b:

  • .venv/bin/ruff format --check: 150 files already formatted.
  • .venv/bin/ruff check: all checks passed.
  • .venv/bin/ty check src/pepper_cli/: all checks passed.
  • .venv/bin/python -m pytest -n auto --cov --cov-report=json:coverage-summary.json: 3344 passed, 2 skipped; total coverage 95.71 percent, floor in .claude/maintainerd.json unchanged at 88.
  • .venv/bin/python -m pytest tests/test_claude_channel.py -k "resync or first_forty or topics_list or tools_list" -q: 19 passed.
  • git diff --check: clean.
  • Diff scan for em and en dashes: no matches.

Deferred

Checklist (repo-specific)

  • uv run ruff format --check and uv run ruff check clean (no new lint ignores)
  • uv run ty check src/pepper_cli/ clean
  • uv run pytest passes; coverage floor in .claude/maintainerd.json not lowered
  • Server-contract changes: N/A, no /api/v1 request, response, or frame changed
  • No token or credential is logged, printed, or put in a fixture
  • README and the bundled SKILL.md updated if commands or output changed
  • Help: N/A, no command or flag changed, and help/cli.md does not describe the notice wording or the tool schema

The resync notice told the agent that each topic came with its room_id and topic_id, then cut the list at 40 with "and N more", so a long list read as complete and an agent could silently miss topics when catching up. Past 40 the notice now says it lists the first 40 of the total and points at topics_list for the rest. The design note and the bundled skill say the same, and a test with 45 topics pins the omission count and the pointer.

Refs Vycari#253

Signed-off-by: Niladri Das <125604915+bniladridas@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T00:50:26.462239Z 0a0bc71 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.

@vycari-review

vycari-review Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Vycari Review

Round 2 on 597817b. The verdict is the Vycari Review check run, and each open finding is an inline thread. Reply on every P0 and P1 thread: Fixed in <sha>, or Disputed: with a reason. P2s are the author's call: fix one, or reply Deferred: #<issue> (the PR's one follow-up issue) or Declined: with a reason, and VR stops re-raising it. From round 2 on, VR raises no new P2s: it checks the fixes and looks for P0s and P1s.

Open: P0 0 · P1 0 · P2 0 · disputed 0 · confirmed fixed 1 · withdrawn 0

Hand-off: Not handed to Greptile yet. 1 Greptile finding(s) not addressed (GR-4570376265): fix each and reply Fixed in <sha> on Greptile's thread, or reply there with Disputed:, Declined: or Deferred: <issue> and a reason. Greptile is not asked again until then.

Greptile follow-through

  • P2 · GR-4570376265 · src/pepper_cli/claude_channel.py:535 · fixed, reply needed (Fixed in <sha> on Greptile's thread) · fixed-confirmed: Greptile pointed out that topics_list could not return archived non-default topics that the resync notice counts, so they stayed hidden. At this head, topics_list takes archived=true and returns all topics, including archived ones. The notice's pointer and the tool schema both name that option.

No open findings this round.

P2s, judge's notes and closed findings

Judge's notes

The earlier finding (and Greptile's matching one) that the resync notice sent the agent to topics_list for archived topics the tool never returned is fixed. topics_list now takes archived=true, and the notice tells the agent to use it. No new candidates survived.

Confirmed fixed

  • VR-2143a88c · Resync pointer sends the agent to topics_list for topics that tool never returns

@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: 0a0bc71797

ℹ️ 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 src/pepper_cli/claude_channel.py Resolved
Comment thread src/pepper_cli/claude_channel.py Resolved
@vycari-review

vycari-review Bot commented Nov 14, 2026

Copy link
Copy Markdown

@greptileai review

Comment thread src/pepper_cli/claude_channel.py Resolved
The resync notice counts every topic the startup map knows, archived ones included, but pointed at topics_list, whose default folds archived topics. An archived topic beyond the 40th row was counted and could never be found through the recovery tool. topics_list now takes archived, mirroring topics list --archived, and the notice asks for it when it truncates. The default listing is unchanged, and tests cover 45 topics whose omitted rows are archived plus the tool's new argument.

Refs Vycari#253

Signed-off-by: Niladri Das <125604915+bniladridas@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

agents claude-channel: make resync topic list honest about the 40-topic cap

1 participant