Skip to content

feat(core): add no-omit mode#199

Merged
vincentkoc merged 5 commits into
mainfrom
feat/no-omit-mode
May 25, 2026
Merged

feat(core): add no-omit mode#199
vincentkoc merged 5 commits into
mainfrom
feat/no-omit-mode

Conversation

@vincentkoc

Copy link
Copy Markdown
Owner

Summary

Validation

  • pnpm exec vitest run test/core/json-protocol.test.ts test/cli/main.test.ts test/core/reduce.test.ts test/core/integrations/compact-bash-result.test.ts
  • pnpm exec tsc -p tsconfig.json --noEmit --pretty false
  • pnpm exec oxlint --deny-warnings src/core/reduce.ts src/core/reduce-formatters.ts src/core/json-protocol.ts test/core/reduce.test.ts test/core/json-protocol.test.ts src/cli/main.ts test/cli/main.test.ts
  • pnpm typecheck
  • pnpm build
  • pnpm verify
  • compiled CLI smoke for env-driven reduce, reduce-json options.noOmit, and wrap
  • autoreview clean: no accepted/actionable findings reported
  • git diff --check origin/main...HEAD
  • privacy scan clean

hxy91819 and others added 5 commits May 25, 2026 01:55
Add a mechanism to suppress all omission/truncation behavior while
preserving formatting transformations (stripAnsi, dedupe, filter,
rewrite, fact-counting). This gives agent workflows a middle ground
between full compaction (default) and --raw (which skips everything).

Motivation: In high-cost agent workflows like OpenClaw auto-review,
omission markers can cause agents to lose critical information that is
expensive or impossible to re-acquire. --raw is too coarse since it
also skips useful formatting. The new flag preserves transformations
but never omits or truncates content.

Changes:

- Add TOKENJUICE_NO_OMISSION env var (truthy: 1, true, TRUE, yes, YES)
  read via shared helper in src/core/env.ts
- Add --no-omit CLI flag to wrap and reduce commands
- Add noOmit?: boolean to ReduceOptions and WrapOptions
- Thread noOmit through all reduce pipeline functions:
  headTail, clampTextWithMetadata, clampTextMiddleWithMetadata,
  clipMiddleWithHash, clipMiddleWithHashStrict, compactWholeJsonText,
  rewriteGitDiffLines, rewriteGhLines, rewriteSearchLines,
  filterGhRunLogSignalLines, formatGhStatusCheckRollup,
  formatCommandList, buildInspectionSummary, formatInline, selectInlineText
- Add CompactionKind passthrough variants:
  no-omit-head-tail-passthrough, no-omit-char-clip-passthrough,
  no-omit-domain-passthrough (all authoritative: false)
- Add createPassthroughCompactionMetadata() for non-authoritative metadata
- Update mergeCompactionMetadata() to preserve authoritativeness
  semantics when merging passthrough with real compaction
- Suppress WRAP_AUTHORITATIVE_FOOTER when noOmit is active
- Include facts in formatInline when noOmit is true (previously relied
  on summary.includes('omitted') which would be empty)
- Remove redundant provisional clamp computation in reduceExecutionWithRules
- Pass --no-omit through runWrap to runWrappedCommand (bugfix: was only
  passed to decorateWrapInlineText, not the reduce pipeline)
- Pass noOmit to buildPackageLockSummary so package samples are not
  truncated when noOmit is active

Tests: env var parsing, headTail/clamp/clip passthrough, domain-level
omission suppression (git diff, gh status, gh run log, GitHub Actions
command list), reduce integration, compactBashResult env var + flag,
wrap --no-omit propagation, inspection summary passthrough.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vincentkoc
vincentkoc marked this pull request as ready for review May 25, 2026 00:13
@vincentkoc
vincentkoc merged commit d42b89f into main May 25, 2026
5 of 6 checks passed
@vincentkoc
vincentkoc deleted the feat/no-omit-mode branch May 25, 2026 00:14
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.

2 participants