Bump pytz from 2021.3 to 2022.5 - #17
Merged
Merged
Conversation
Bumps [pytz](https://github.com/stub42/pytz) from 2021.3 to 2022.5. - [Release notes](https://github.com/stub42/pytz/releases) - [Commits](stub42/pytz@release_2021.3...release_2022.5) --- updated-dependencies: - dependency-name: pytz dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Codecov Report
@@ Coverage Diff @@
## main #17 +/- ##
=======================================
Coverage 66.19% 66.19%
=======================================
Files 47 47
Lines 1855 1855
=======================================
Hits 1228 1228
Misses 627 627 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
JSv4
added a commit
that referenced
this pull request
May 28, 2026
- Document legacy history-processor signature contract in make_pydantic_ai_agent: ProcessHistory dispatches on the first parameter's type annotation, so an untyped 2-arg processor crashes at runtime — callers wanting (ctx, messages) MUST annotate as RunContext. - Add CLAUDE.md pitfall #17: history_processors.py import-time RuntimeError on pydantic-ai dataclass-shape drift. - Type on_in_run_shrink as Callable[[InRunShrinkEvent], None] (direct import — there is no cycle to defer behind TYPE_CHECKING). - Soften "no shrinkable content" / "no older messages" logs from WARNING to INFO with rationale; pin the level in the unit test. - Replace fragile result[1] index in test_drops_older_thinking_parts with a next(...) lookup keyed on the ToolCallPart's tool_call_id. - Promote the trim-notice marker to a public constant (IN_RUN_TRIM_NOTICE_MARKER in constants/context_guardrails.py); the private template composes from it and tests import the public form. - Add upstream pydantic-ai source pointers to _agent_capabilities() so the AttributeError tripwire is faster to diagnose on a bump.
JSv4
added a commit
that referenced
this pull request
May 28, 2026
* Add IN_RUN_* constants for in-run history compaction
* Extend CompactionConfig with in-run history-processor knobs
Adds four new fields to CompactionConfig (in_run_enabled,
in_run_keep_recent_pairs, in_run_tool_return_target_chars,
in_run_drop_thinking) wired to the constants added in the previous
commit. __post_init__ validates the two integer fields are >= 1.
Covers the new surface with four SimpleTestCase tests.
* Add on_in_run_shrink telemetry callback to PydanticAIDependencies
* Add shrink_old_artifacts_processor for in-run history compaction
* Address Task 4 review findings: production config path, DRY, empty-parts guard
Fix 1: Add `compaction: CompactionConfig` field to PydanticAIDependencies so
the in-run HistoryProcessor reads its knobs from the correct production path
(`deps.compaction`) instead of the non-existent `deps.config.compaction`.
Update `_resolve_config` to try `deps.compaction` first (production), then
`deps.config_compaction` (test-stub legacy), then fall back to defaults.
Fix 2: Collapse the duplicated string/non-string branches in
`_shrink_tool_return_part` into a single unified path — stringify once, then
apply the same truncation arithmetic regardless of the original type.
Fix 3: Guard `_shrink_message`'s ModelResponse branch so that dropping
ThinkingParts from a response that contains only ThinkingParts leaves the
message intact rather than producing an empty parts list.
Fix 4: Correct docstring typo in `_split_protected_suffix` ("any trailing
leading ModelRequest" → "any trailing ModelRequest").
Fix 5: Add missing `tool_returns_shrunk == 1` assertion to
`test_drops_older_thinking_parts`.
Two new regression tests added: `test_resolves_compaction_from_deps_compaction_field`
and `test_thinking_only_modelresponse_is_not_emptied`. Total: 12 tests, all passing.
* Inject in-run history processor in make_pydantic_ai_agent
Wire shrink_old_artifacts_processor as the first history_processors entry
on every Agent constructed through the factory chokepoint. Caller-supplied
processors are preserved after ours.
Also tightens the ctx parameter annotation on the processor from Any to
RunContext so pydantic-ai's takes_run_context() introspection invokes the
two-argument form. The _FakeRunContext call sites in
test_history_processors.py get type: ignore[arg-type] (runtime-correct;
mypy suppression only).
The Agent(history_processors=...) constructor parameter is deprecated in
pydantic-ai 1.62 in favour of a v2 API (capabilities=[ProcessHistory(fn)]
or Hooks(before_model_request=fn)) — but that replacement API does NOT
ship in 1.62 yet (neither ProcessHistory nor Hooks is exported), so the
deprecated form is the only workable path. We silence the forward-looking
PydanticAIDeprecationWarning with a narrowly-scoped warnings filter that
targets only that custom warning class.
* Surface in-run shrink events in the streaming timeline
Wire the in-run HistoryProcessor's on_in_run_shrink callback in
_stream_core so that when in-loop compaction fires during a streamed
chat, a ThoughtEvent is appended to the TimelineBuilder and becomes
visible in the UI timeline. Non-streaming (_chat_raw) callers leave the
callback unset and continue to receive log-only telemetry from the
processor.
* CHANGELOG: in-run history compaction via pydantic-ai history_processors
* Migrate in-run processor to pydantic-ai capabilities API (ProcessHistory)
* CHANGELOG: drop obsolete deprecation note now that we use capabilities API
* Address PR #1817 review: propagate CompactionConfig + polish
Main fix (Medium severity from Claude review):
- ``PydanticAICoreAgent._apply_context_budget`` now copies the full
``config.compaction`` onto ``agent_deps.compaction``. Previously
only ``threshold_ratio`` was forwarded, so per-conversation
overrides to ``in_run_enabled`` / ``in_run_keep_recent_pairs`` /
``in_run_tool_return_target_chars`` / ``in_run_drop_thinking``
silently defaulted inside the in-run history processor. Pinned by
a new regression test in ``TestRefreshContextBudgetFallback``.
Cleanup:
- ``_resolve_config`` drops the ``config_compaction`` test-stub
fallback branch. ``_FakeDeps`` in ``test_history_processors.py``
now mirrors the production attribute name (``compaction``), and
the previously-separate ``_ProdDeps`` test stub collapses into
``_FakeDeps``.
- ``test_drops_older_thinking_parts`` replaces the positional
``result[7]`` lookup with a predicate-based find so the test stays
self-documenting if the fixture grows.
- ``test_pydantic_ai_factory.py`` routes the three new
``root_capability.capabilities`` accesses through a single
``_agent_capabilities`` helper that documents the brittle internal
contract and raises a precise tripwire if pydantic-ai renames it.
- ``history_processors.py`` consolidates the dual
``import dataclasses`` + ``from dataclasses import dataclass``
into a single ``from dataclasses import dataclass, replace``.
CHANGELOG updated under ### Fixed.
* Address PR #1817 Claude review #2: defensive guards + callback test
Items addressed from the second review pass (the first review's items
were already in 7501a95 / c8916ea):
- Import-time guard: assert ToolReturnPart, ModelRequest, ModelResponse
remain stdlib @DataClass. dataclasses.replace silently fails on
BaseModel instances; the outer try/except in
shrink_old_artifacts_processor would have swallowed the resulting
TypeError into a no-op. The guard makes the next pydantic-ai bump
that breaks the assumption visible in CI.
- New regression test test_callback_exception_does_not_propagate
pinning the contract that a raising on_in_run_shrink callback is
caught locally inside the callback block (logger.exception fires),
not by the outer try/except — so the actual shrink work survives
telemetry-sink failures. The previous # pragma: no cover - defensive
marker is dropped now that the path is covered.
- Docstring clarity on _split_protected_suffix explaining the "pairs"
terminology vs. the response-boundary anchor (the split point is the
Nth most-recent ModelResponse; trailing ModelRequests stay with the
recent suffix).
- Inline comment near the threshold computation noting that
threshold_ratio is shared by design between the in-run processor and
the outer MessageHistoryService compaction — future tuning should
treat both layers together.
CHANGELOG updated with two new Fixed entries.
* Address PR #1817 Claude review #3
- Document legacy history-processor signature contract in
make_pydantic_ai_agent: ProcessHistory dispatches on the first
parameter's type annotation, so an untyped 2-arg processor crashes
at runtime — callers wanting (ctx, messages) MUST annotate as
RunContext.
- Add CLAUDE.md pitfall #17: history_processors.py import-time
RuntimeError on pydantic-ai dataclass-shape drift.
- Type on_in_run_shrink as Callable[[InRunShrinkEvent], None] (direct
import — there is no cycle to defer behind TYPE_CHECKING).
- Soften "no shrinkable content" / "no older messages" logs from
WARNING to INFO with rationale; pin the level in the unit test.
- Replace fragile result[1] index in test_drops_older_thinking_parts
with a next(...) lookup keyed on the ToolCallPart's tool_call_id.
- Promote the trim-notice marker to a public constant
(IN_RUN_TRIM_NOTICE_MARKER in constants/context_guardrails.py); the
private template composes from it and tests import the public form.
- Add upstream pydantic-ai source pointers to _agent_capabilities()
so the AttributeError tripwire is faster to diagnose on a bump.
---------
Signed-off-by: JSIV <5049984+JSv4@users.noreply.github.com>
This was referenced May 28, 2026
This was referenced Aug 31, 2026
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.
Bumps pytz from 2021.3 to 2022.5.
Commits
1ab3481Bump version numbers to 2022.5 / 2022ec5900e5IANA 2022e872168cSquashed 'tz/' changes from 0fc8f915a..16bd7a38404b5402Bump version numbers to 2022.4/2022d8eeefc3Squashed 'tz/' changes from b61a7acb4..82693eb52d901dafIANA 2022da6867f1Bump version numbers to 2022.2.1/2022b07aa4d9Revert inclusion of PACKRATDATA=backzonea5c6756Update dead linkb247b50Remove obsolete Travis configDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)