Skip to content

feat(limits)!: register producer.output_bytes as the session default for bounded producer output - #14648

Merged
morluto merged 7 commits into
mainfrom
limits/producer-output-setting
Nov 26, 2026
Merged

morluto merged 7 commits into
mainfrom
limits/producer-output-setting

Conversation

@morluto

@morluto morluto commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Part of #14237. This registers one session-adjustable default for the producer-output limit family: the analysis setting producer.output_bytes, launch seed REA_PRODUCER_OUTPUT_BYTES, changeable with update_analysis_settings. It supplies the omitted producer_limits.output_bytes for the producers that share BOUNDED_PRODUCER_LIMITS: inspect_packet_capture, decode_signal_recording and inspect_signal_decoders.

Why one setting, and why these operations

  • The cost. Every setting ID is enumerated in update_analysis_settings' advertised schema, so each new setting costs tokens in every session. This PR adds exactly one.

  • Why it is worth it. An agent decoding a series of large captures or recordings hits the same 4 MiB output budget each time. Without a session default it must repeat producer_limits.output_bytes on every call.

  • Why only these operations. They form one family in code. They share BOUNDED_PRODUCER_LIMITS, retain plain producer text, and have the same 4 MiB default and 1..MAX_SAFE_INTEGER range, so one setting limit reports their bounds correctly.

  • Deliberately excluded:

    Folding any of these in would need per-operation defaults, which one setting limit cannot report.

  • No capture.* reuse. The existing capture.* settings are a different family: web-capture decoder heap and TShark JSON expansion.

  • No diagnostic_bytes setting. Only pwntools and EVM offer that field, and neither is a plausible repeated session raise.

Behavior

  • Precedence: the per-call producer_limits.output_bytes wins, then the runtime override, then REA_PRODUCER_OUTPUT_BYTES, then the 4 MiB default. The result's limits.output_bytes reports the value in force.
  • Invalid seed: an invalid REA_PRODUCER_OUTPUT_BYTES is a configuration refusal; it is not replaced by the default.
  • Refusal shape:
    • The output refusal reports the setting's limit (setting, parameter: "producer_limits.output_bytes", source, and update_mode of runtime, or parameter for a request value).
    • The generated recovery from feat(limits)!: report the value a per-call limit needs and derive its recovery #14625 names the per-call field, then update_analysis_settings for this session, or the launch variable on the CLI.
    • No required_value: the capture stops at the budget, so the need is not measured.
  • Shared helper: ArtifactAnalysisResources.commandContext now takes the output control from its caller instead of building a parameter limit itself. Its duplicated recovery prose is removed, matching fix(limits)!: let apktool and assetutil take producer_limits.output_bytes and type Android and process capture refusals #14624.

Evidence and regression coverage

  • tests/boundary/signals/recordingProvider.test.ts:
    • A discovery overflow at the default reports the setting limit with source: "default". Its recovery names both producer_limits.output_bytes and producer.output_bytes.
    • A runtime override of 1024 refuses with source: "runtime", and an 8 MiB override admits the same 5 MiB output.
    • A per-call 2048 wins over the 8 MiB override, with source: "request" and update_mode: "parameter".
  • src/application/AnalysisSettings.test.ts passes with the new setting.

Validation performed

The machine was under heavy load, so per the coordinator I ran one targeted file at a time. CI runs typecheck, full lint and the broad suites.

  • Targeted vitest on the two new sigrok tests and AnalysisSettings.test.ts: passed
  • npm run build:cached (src compile): clean
  • npm run verify:advertised-schemas -- --update-summary: inspect_analysis_settings and update_analysis_settings summaries updated
  • npm run docs:check, node scripts/verify/architecture-guards.mjs, node scripts/verify/rea-numeric-limits.mjs: passed

Docs

  • docs/reference/limits-and-recovery.md: new "Session default for producer output" section with the setting ID, the seed, an update_analysis_settings example, the precedence, and the excluded operation.
  • docs/reference/rea-limit-inventory.md: new row.

Compatibility

Breaking: refusals at this budget now report a setting limit (with parameter and source) in details.limit in place of a bare parameter limit. Admission behavior is unchanged when the setting and its seed are unset.

…or bounded producer output

inspect_packet_capture, decode_signal_recording and inspect_signal_decoders
share BOUNDED_PRODUCER_LIMITS, and an agent decoding several large captures or
recordings raised producer_limits.output_bytes on every call. The registered
setting producer.output_bytes (seed REA_PRODUCER_OUTPUT_BYTES, default 4 MiB)
now supplies the omitted field. A per-call value wins, then the runtime
override, then the seed, then the default. An output refusal reports the
setting's limit with its parameter and source, so the generated recovery
names both routes.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T03:52:28.284543Z
We couldn’t complete this review. Comment @codex review to try again.
5a9ead5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@morluto morluto changed the title feat(limits): register producer.output_bytes as the session default for bounded producer output feat(limits)!: register producer.output_bytes as the session default for bounded producer output Nov 26, 2026
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · No new blocking issue was found; these exact changes are already present on local main.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] No new blocking issue was found; these exact changes are already present on local main.

Summary

Adds producer.output_bytes as the session default for packet inspection, signal decoding and decoder discovery.

  • Packet and signal producers can share a session output budget.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Producer call] --> B{Explicit output budget?}
  B -- Yes --> F[Use request value]
  B -- No --> C{Runtime override?}
  C -- Yes --> G[Use runtime value]
  C -- No --> D{Launch seed?}
  D -- Valid --> H[Use launch value]
  D -- Absent --> I[Use 4 MiB default]
  D -- Invalid --> J[Retry retained cleanup, then refuse]
  F --> K[Collect output under selected budget]
  G --> K
  H --> K
  I --> K
  K --> L{Budget exceeded?}
  L -- Yes --> M[Report control, source and recovery]
  L -- No --> N[Parse and report effective limits]
Loading

Reviews (7) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread src/signals/SigrokRecordingProvider.ts Resolved
Comment thread src/config/producerOutputBytesSeed.ts Resolved
@morluto
morluto enabled auto-merge (squash) November 26, 2026 05:13
The session setting and per-call field are already on details.limit.
The refusal carries the same control, setting, and source.
@cursor

cursor Bot commented Nov 26, 2026

Copy link
Copy Markdown

@greptileai please review the current head 543c77a64.

@morluto
morluto merged commit 6ae722a into main Nov 26, 2026
55 checks passed
@morluto
morluto deleted the limits/producer-output-setting branch November 26, 2026 06:06
@morluto morluto added area: domain Domain logic, errors, and pure functions enhancement New feature or request labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants