Catalog/P family/P10
Proposed specificationSource-located exemplarH1H2

Capped output and remediation errors

Bound observations while enabling recovery.

JOIN POINTobservation_boundaryRECORD STATUSCandidate · v0.1.0
UML class view for Capped output and remediation errors, showing participant roles, received calls, and analytical dependencies
FIG. P10 / UML CLASS VIEW
Object interaction diagram for Capped output and remediation errors, showing role collaboration and a numbered message sequence
FIG. P10 / OBJECT INTERACTIONS
Context
A tool or environment can emit output larger than the context allowance.
Trigger
Output crosses a size or token cap.
Structure
Limit policy, truncation metadata, and access to complete artifacts.
Effect
The harness returns a bounded observation with explicit recovery information.
Requires
Output size is measurable and original content remains addressable.
Ensures
The consumer knows truncation occurred and can seek the full result.
Invariant
Truncation never masquerades as complete evidence.
Violation
Oversized or unavailable output returns a typed remediation error.

Negative control

A logging length limit unrelated to agent observations does not count.

Permitted variation

Character, line, token, structure-aware caps, summaries, and repair hints.

Test obligation

Test exact limit, over-limit, non-UTF8, complete-artifact retrieval, and retry.

Evolution question

Did remediation become a typed contract rather than only text truncation?

PROMPT SKETCH
Cap large observations at the boundary. Tell the consumer that truncation occurred and keep the full content addressable through a stable handle; never silently return a prefix as if it were complete.
CODE DESIGN / PYTHON
def cap_observation(observation, limit):
    if len(observation.content) <= limit:
        return observation
    handle = store.put(observation.content)
    preview = observation.content[:limit]
    return Observation(
        content=preview,
        truncated=True,
        full_ref=handle,
        repair_hint=f"read({handle}, offset=...)",
    )

Illustrative design sketch. A truncation flag without a retrieval path turns a size limit into lost evidence. This example is a teaching aid, not implementation evidence or a conformance claim.

Join point
observation_boundary
Source locator
See the source record.
Lexical cue
(?i)\b(?:max_output|output[_-]?limit|truncat(?:e|ed|ion)|remediat(?:e|ion))\bFrozen expression, v0.1.0. A match is a retrieval cue, not a confirmed implementation.
Aliases
None
Canonical exemplar
openai/openai-agents-pythonsrc/agents/sandbox/util/token_truncation.py:73Support: tests/sandbox/test_token_truncation.py:1
Negative control
A logging length limit unrelated to agent observations does not count.

Scope-anchored review. pohe-agent analyze <repo> --pattern P10 anchors the cue to its enclosing declaration and checks a separate operational signature for all four pointcut dimensions. Missing roles and negative-control risks remain visible; a structural match is not E2/E3. Calibration report ↗

Source-located exemplar

A concrete source anchor is available for this proposed record. It is one exemplar, not evidence that all repositories—or every contract field—conform.

Review boundary: this candidate and its specification come from an AI-assisted study. Independent human validation remains open.

ANY-EVIDENCE FAMILY COVERAGE36/36

100.0% of repository families in the frozen panel have at least one current cue, historical cue, or canonical source layer. This is not confirmed prevalence.

Current lexical-cue repositories: 40 / 41
Canonical source anchoropenai/openai-agents-python 86bd29878b30src/agents/sandbox/util/token_truncation.py:73

Bounded output with explicit truncation metadata.

Exploratory retrieval cue Regex / v0.1.0
(?i)\b(?:max_output|output[_-]?limit|truncat(?:e|ed|ion)|remediat(?:e|ion))\b

This expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.