Repository navigation
feat(research): multi-day runs — no turn cap without a gate, mid-send saves, dedup, smaller images, append tool - #402
Merged
Merged
Conversation
… saves, dedup, smaller images, append tool Lessons from a 5h+/1,095-thread live crawl: - turn cap: sessions with no live gate (research/notes/chat) run uncapped; gated builds and plan mode keep the 1000-turn backstop; TSFORGE_MAX_TURNS overrides (0 = unlimited). Re-evaluated each turn so a waking gate applies. - the REPL saves the session on every checkpoint (every 40 turns), so a crash or reboot mid-send no longer loses the conversation for --continue - TTSR stream rules (TypeScript: no-as-cast…) are off while build mode is suppressed — they fired on prose about guitar wiring - reddit_thread refuses threads already logged in sources.md unless force; within a session any chunk is served from cache. New reddit_mark_read logs threads covered another way (earlier crawls). The run had 64 duplicates. - images: Reddit's <=1080px rendition instead of originals (~5x smaller; the run saved 1.3 GB), 20 post + 10 comment images per thread - append tool: add lines to a data file (jsonl/csv/log) without an edit anchor; JSONL validated, code/config refused. Replaces anchored edits that failed on stale/ambiguous anchors
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tsforge | e03168a | Commit Preview URL Branch Preview URL |
Sep 26 2026, 07:37 PM |
Merged
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 from the first long live Reddit crawl: 5h+, 1,095 threads, ended by the 1000-turn backstop.
No turn cap for research
TSFORGE_MAX_TURNSoverrides either: a number caps every session,0means unlimited.Session.turnCap()), so an auto gate that wakes mid-send brings the backstop back.Saving during long sends
The REPL now saves the session on every
checkpointevent (every 40 turns), viawithCheckpointHook. Before, it only saved when a send ended, so a crash or reboot on day two lost the whole conversation for--continue.TypeScript stream rules off in research sessions
TTSR rules ("no
ascast / noas any") are skipped while build mode is suppressed (no code yet, or gate cleared). They interrupted the model three times on prose about guitar wiring.Reddit: no duplicate reads
reddit_threadrefuses a thread already logged insources.mdunlessforce: true. Within a session, any chunk (including chunk 1) is served from cache, never refetched.reddit_mark_readlogs threads covered another way (earlier crawls, URL lists) so they're skipped. It's in the playbook for resuming research.sources.mdexisted).Reddit: smaller images
media_metadata.p, postpreview.resolutions) instead of full originals, about 5× smaller. The run had saved 1.3 GB.New
appendtool.jsonl, CSV, logs) with no edit anchor, creating the file if needed...paths, absolute paths,node_modules/,.git/,.tsforge/, and symlinked escapes.editappends, which failed 5 times on stale or ambiguous anchors in the run.Tests
session-long-runs.test.tsincludes a real 1,005-turn no-gate send that finishes asresponded, plus theTSFORGE_MAX_TURNScap and parsing, the gated backstop, checkpoints, and TTSR off/on.append-tool.test.ts.bun run ci:localpasses: 6191 tests, 0 failures. The docs build passes.Not covered by tests
The REPL line that binds
persistto the checkpoint hook. The hook itself and the checkpoint events are tested.Docs:
TSFORGE_MAX_TURNSin the flags reference;integrations/chrome.mdx"Long runs" (no cap, saves,append, TTSR);integrations/reddit.mdx(refuse/force,reddit_mark_read, image sizes and caps,append).