Skip to content

feat(cli): ObservationPack — archive big tool results, substitute handle+excerpt at third send - #881

Open
drew913s wants to merge 2 commits into
qwen-code-dev-bot:mainfrom
Rocktalk-Holdings:mhga2a-observation-pack
Open

drew913s wants to merge 2 commits into
qwen-code-dev-bot:mainfrom
Rocktalk-Holdings:mhga2a-observation-pack

Conversation

@drew913s

Copy link
Copy Markdown

Implements ObservationPack (SoL-Pi): tool results over OMC_SPILL_BYTES (default 10240) are archived in full to ~/.oh-my-cli/sessions/<sessionId>.spill/<seq>.log on arrival, ride in full for two provider sends, and are then replaced in the live in-memory transcript with a marker line, a ~1 KB complete-line head/tail excerpt, and a retrieval handle. One rewrite per result (idempotence marker); the most recent two tool messages are never rewritten. The session JSONL stays full-fidelity (append at push time, before any rewrite); compaction is unaffected. The read tool now also accepts absolute spill paths under ~/.oh-my-cli/sessions/*.spill/. OMC_SPILL_DEBUG=1 appends spill/rewrite events to <sessionId>.spill/events.log.

Tests: tests/unit/observation-pack.test.ts (17 tests) — spill-on-arrival, rewrite at exactly the third send + idempotence, small results untouched, excerpt/handle shape, JSONL fidelity, read-tool offset/limit paging of a spill file, path-guard refusal outside *.spill/, shell/grep reachability. tsc clean; targeted suite green. (8 pre-existing failures in provider-invocation/side-question at the base commit are an environment issue — the estate's node-fetch 'Premature close' fix lives on the telnyx-compat branch, not on main.)

Note: opened from the Rocktalk-Holdings fork; the pushing account has no write access to this repo. The estate executor branch (rocktalk telnyx-compat) carries a ported version of this change.

…handle+excerpt at third send (ObservationPack)

Tool results over OMC_SPILL_BYTES (default 10240) are written in full to
~/.oh-my-cli/sessions/<sessionId>.spill/<seq>.log on arrival, ride in full
for the next two provider requests, and are then replaced in the live
in-memory transcript with a marker line, a ~1 KB complete-line head/tail
excerpt, and a retrieval handle (read tool with offset/limit, or grep).
One rewrite per result (idempotence marker), never the most recent two
tool messages, never results at or under the threshold. The on-disk
session JSONL stays full-fidelity (append at push time, before any
rewrite); compaction is unaffected. The read tool now also accepts
absolute spill-file paths under ~/.oh-my-cli/sessions/*.spill/ so a seat
can page its own archived output. OMC_SPILL_DEBUG=1 appends spill/rewrite
events to <sessionId>.spill/events.log for rollout verification.
…rival, bind live message at push

Matches the estate executor integration where harness truncation runs
between arrival and push; on main the two are adjacent so behavior is
unchanged. The API split keeps both branches on one design.
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