release: 1.77.0#664
Conversation
46f336f to
6881f1c
Compare
6881f1c to
81598b8
Compare
| custom_headers_env = os.environ.get("MODERN_TREASURY_CUSTOM_HEADERS") | ||
| if custom_headers_env is not None: | ||
| parsed: dict[str, str] = {} | ||
| for line in custom_headers_env.split("\n"): | ||
| colon = line.find(":") | ||
| if colon >= 0: | ||
| parsed[line[:colon].strip()] = line[colon + 1 :].strip() | ||
| default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} |
There was a problem hiding this comment.
🚩 copy(set_default_headers=...) semantics changed by env header injection
The copy() method at src/modern_treasury/_client.py:521 passes headers to __init__(), which now re-reads MODERN_TREASURY_CUSTOM_HEADERS from the environment at line 204-211. When a user calls copy(set_default_headers={}) intending to clear all custom headers, env-derived headers would still be injected via {**parsed, **default_headers}. This is a semantic change to set_default_headers — previously it would result in zero custom headers, now env headers persist. This is likely intentional (env headers are always-on infrastructure config), but it's worth documenting since it changes the contract of set_default_headers. The same applies to the async client at line 664.
Was this helpful? React with 👍 or 👎 to provide feedback.
81598b8 to
fb5fa8c
Compare
fb5fa8c to
2164c9b
Compare
2164c9b to
4536df9
Compare
4536df9 to
cdc0888
Compare
cdc0888 to
4438585
Compare
4438585 to
3401eda
Compare
3401eda to
426c7e1
Compare
426c7e1 to
db0e123
Compare
db0e123 to
fd10854
Compare
1498dd3 to
b65f374
Compare
b65f374 to
a9c8cfd
Compare
a9c8cfd to
5b1894b
Compare
| amount: int | ||
| """Value in specified currency's smallest unit. | ||
|
|
||
| e.g. $10 would be represented as 1000. Can be any integer up to 36 digits. | ||
| """ | ||
|
|
||
| amount_string: str | ||
| """ | ||
| The amount of the ledger entry as a string, preserving full precision for values | ||
| that may exceed safe integer limits in some languages. | ||
| """ |
There was a problem hiding this comment.
🚩 LedgerEntryCreateRequest.amount changed from Required to optional
In both src/modern_treasury/types/shared/ledger_entry_create_request.py and src/modern_treasury/types/shared_params/ledger_entry_create_request.py, amount was changed from a required field to optional (Optional[int] = None / non-Required). The new amount_string field is also optional. This means neither amount nor amount_string is required, which could allow creating a ledger entry with no amount specified. This appears to be an intentional API spec change (the server presumably validates that at least one is provided), but callers relying on the type system to enforce amount presence will no longer get that guarantee.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "USDB", | ||
| "USDC", | ||
| "USDG", | ||
| "USDP", |
There was a problem hiding this comment.
🚩 Currency enum removes USDB and USDP stablecoin values
In both src/modern_treasury/types/shared/currency.py and src/modern_treasury/types/shared_params/currency.py, the USDB and USDP currency values were removed from the Currency type. If any existing API consumers are using these currency values, their code would still work at runtime (the values are just strings sent to the API), but type checkers would flag them. This is a potentially breaking change for users relying on these specific currencies.
Was this helpful? React with 👍 or 👎 to provide feedback.
5b1894b to
32b4c97
Compare
32b4c97 to
18aa125
Compare
18aa125 to
0d541c8
Compare
0d541c8 to
dfb720c
Compare
dfb720c to
3f8b51e
Compare
3f8b51e to
0eea14c
Compare
0eea14c to
745faf4
Compare
745faf4 to
7c23ddb
Compare
7c23ddb to
764fcfa
Compare
| ) | ||
|
|
||
|
|
||
| class _EagerIterable(list[_T], Generic[_T]): |
There was a problem hiding this comment.
🚩 _EagerIterable inherits from list[_T] but is only used as Annotated metadata
The _EagerIterable class inherits from list[_T] and Generic[_T], but is never instantiated directly — it's only used as metadata in Annotated[Iterable[_T], _EagerIterable]. The list inheritance seems unnecessary for its purpose as a pydantic schema marker. However, pydantic v2 does look for __get_pydantic_core_schema__ on metadata classes, and the implementation correctly uses @classmethod and @staticmethod methods. The list[_T] base class requires Python 3.9+ at runtime (since it's a base class, not an annotation, from __future__ import annotations doesn't help). This is presumably acceptable given the project's Python version requirements.
Was this helpful? React with 👍 or 👎 to provide feedback.
764fcfa to
76c5da1
Compare
76c5da1 to
94bb05d
Compare
Automated Release PR
1.77.0 (2026-06-13)
Full Changelog: v1.76.0...v1.77.0
Features
Bug Fixes
Chores
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions