Repository navigation
Conversation
…792) Nothing in SAGE moves the seat's shared-context checkout, so a reply pushed after the last time some session pulled sat unseen (cbp 11-19: 13 commits behind, two replies to cbp-being missing). Each beat now fetches (remote- tracking refs only, at most every 5 min, 20 s timeout) and reads the forum posts on origin/main the working tree lacks with cat-file. The tree, index and branch are never touched. A failed fetch is recorded in the beat's forum_replies.upstream.why; disk replies still come. SAGE_FORUM_FETCH=0 turns the fetch off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #792 with option (c) from the issue.
The problem:
forum_repliesreads the seat's checkout of shared-context, and nothing in SAGE moves that checkout. A reply pushed after some session last pulled sits unseen. On cbp on 11-19 the checkout was 13 commits behind and missing two replies to cbp-being.What this changes (
sage/gateway/forum_replies.pyonly):for_beatrunsgit fetch -q originbefore reading. That moves only remote-tracking refs. The fetch runs at most once every 5 min (FETCH_EVERY_S), judged byFETCH_HEAD's mtime, so a fetch by any session counts. It has a 20 s timeout and runs with no prompts (GIT_TERMINAL_PROMPT=0; BatchMode ssh unlessGIT_SSH_COMMANDis already set).forum/onorigin/mainthat the working tree doesn't have are read withgit cat-file --batch. They then go through the same filter as disk posts: addressed to the being, not yet shown, at most 7 days old.origin/main:forum/<name> — not in this checkout yet. The excerpt still carries the words.forum_replies.upstream.why. Replies on disk are still offered.forum_replies.upstream={fetched, unpulled, offered[], why?}. This lets anyone see when a reply came from upstream rather than from disk.SAGE_FORUM_FETCH=0turns the fetch off. Whateverorigin/mainalready holds is still read.Tests: new
test_forum_replies_unpulled.py, 9 tests. Each builds a real bare origin, the seat's clone and a peer clone. They cover:HEADandgit statusare unchanged, including a sibling's untracked file;SAGE_FORUM_FETCH=0;Results:
test_forum_replies.py: 24 passed.McNugget's own
~/repos/shared-contextis current (0 behind) only because my seat tick pulls it each hour. A being on a machine with no such session is the case this fixes.🤖 Generated with Claude Code