Repository navigation
Let one setting cap summaries at once for chat and import - #190
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
Both execution paths use the shared setting, legacy values remain supported, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Unifies chat and import summary concurrency under one setting, allowing users to reduce parallel requests to match provider limits.
Changes:
- Renames
importJobstojobsand applies it to chat and imports. - Preserves legacy configuration values and adds migration coverage.
- Updates documentation for the shared setting and when changes apply.
| File | Description |
|---|---|
| test/settings.test.ts | Updates validation tests and covers legacy configuration loading. |
| src/settings.ts | Defines the shared setting and legacy fallback. |
| src/memory.ts | Updates the concurrency parameter comment. |
| src/index.ts | Passes the shared setting to chat and imports. |
| src/import/job.ts | Uses the renamed default and updates its comment. |
| README.md | Documents shared concurrency and legacy compatibility. |
| docs/recipe-differences.md | Describes configurable summary concurrency. |
Review effort: Balanced
This was referenced Oct 17, 2026
Merged
delneg
added a commit
to delneg/opt-chat
that referenced
this pull request
Oct 20, 2026
A compaction's context was the compactions' view up to its node, and the view counts a line not summarized as nothing. At the start of an import, short messages are built at once, merges far ahead got ready, and each saw hundreds of message heads: 380 KB at the median, 900 KB at most, against 16 to 32 KB. One import cost $281 of compactions in a morning. Now, as in UniiChat (Memory.ts build, `upto`; fit, `seen`), the compactions' view holds built lines alone and ends at the first message not summarized; a node starts only when its context ends near the frontier; the cached first message ends before any line not built. https://github.com/VictorTaelin/UniiChat/blob/main/Memory.ts Imported messages are marked and built after the chat's own, and a turn waits for the chat's lines alone (UniiChat's sides). -jobs sets the compactions running at once, after jonaslsaa/pi-optchat#190. An imported chat's AI replies are of kind ai, not opt: another AI's words, which Opt must not take for its own (UniiChat prompt.txt). Also: calls waiting on a prefix go as its writer's response begins (UniiChat AskAI.ts single flight); free lines are written in one write; zoom's error lists the valid forms and the roots; an unreadable view.json is kept aside (after https://github.com/mneves75/uniichat). TestCacheReplay replays 4,000 messages with an import burst against a fake cache, after UniiChat's cache.test.ts: master reads 37% of compactions' input from the cache and sends one 527 KB; now 83%, none over 32 KB. docs/2026-10-20-compaction-context.md has the measurements. 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.
Chat compaction always ran 8 summaries in parallel (
jobs = 8inMemory.open), so a provider that caps parallel requests below that (7 in #186) got 429s on every burst. Only imports had a setting for it.Fix: the import setting now covers both.
importJobs("Import: summaries at once") is renamed tojobs("Summaries at once", still default 8, 1 to 64) and is passed intoMemory.openfor chat as well as intorunImport. Chat picks a change up the next time the profile opens (e.g./reload); imports on the next import.Legacy key: a
config.jsonthat still hasimportJobsand nojobskeeps its value (one line inreadSettings); the next save writesjobsonly. One test covers that.README and docs/recipe-differences.md updated.
Closes #186