Skip to content

fix(credential_pool): parse ISO-string last_status_at during from_dict rehydration (#25516)#25576

Closed
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/gpt-pool-last-status-at-iso
Closed

fix(credential_pool): parse ISO-string last_status_at during from_dict rehydration (#25516)#25576
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/gpt-pool-last-status-at-iso

Conversation

@shellybotmoyer

Copy link
Copy Markdown
Contributor

Summary

Fixes the TypeError: can only concatenate str (not "int") to str crash that occurs when a GPT-family provider pool entry is rehydrated from disk after a rate-limit hit.

Root Cause

PooledCredential.from_dict() was directly passing the last_status_at value from the serialized payload into the dataclass constructor. to_dict() serializes last_status_at as-is, which means an ISO-8601 string (e.g. "2026-05-11T08:23:20.891066+00:00") gets stored in JSON and later read back as a str. When _exhausted_until() runs entry.last_status_at + _exhausted_ttl(...), the expression is str + int, which raises TypeError.

Fix

After extracting last_status_at from the payload, if it is a str, normalize it through the existing _parse_absolute_timestamp() helper (which already handles ISO strings, epoch floats, and epoch milliseconds). This ensures the rehydrated entry has a float epoch value, matching the type the rest of the code expects.

Test Plan

  • pytest tests/agent/test_credential_pool.py — 43 passed.

Related

Closes #25516

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder duplicate This issue or pull request already exists P1 High — major feature broken, no workaround labels May 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #25528 (and #25531) — same fix for PooledCredential.from_dict() not applying _parse_absolute_timestamp() to ISO-string last_status_at. All three PRs fix #25516.

teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for 10 contributors from the
low-hanging-fruit salvage group 2 batch:
- @shellybotmoyer (PR #26661, #25576)
- @ether-btc (PR #26632)
- @LifeJiggy (PR #26516)
- @nekwo (PR #26481)
- @flooryyyy (PR #26374)
- @dgians (PR #26034, incl. zealy-tzco bot-committer alias)
- @flanny7 (PR #27030)
- @hermesagent26 (PR #26438)
- @kriscolab (PR #26926, co-author on salvage commit)
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27292 — your commit was cherry-picked onto current main as part of a batch salvage of low-risk new-contributor PRs. Authorship preserved (fix(credential_pool): parse ISO-string last_status_at during from_dict rehydration). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
@konsisumer konsisumer mentioned this pull request May 31, 2026
1 task
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…tors

Adds release-note attribution mappings for 10 contributors from the
low-hanging-fruit salvage group 2 batch:
- @shellybotmoyer (PR NousResearch#26661, NousResearch#25576)
- @ether-btc (PR NousResearch#26632)
- @LifeJiggy (PR NousResearch#26516)
- @nekwo (PR NousResearch#26481)
- @flooryyyy (PR NousResearch#26374)
- @dgians (PR NousResearch#26034, incl. zealy-tzco bot-committer alias)
- @flanny7 (PR NousResearch#27030)
- @hermesagent26 (PR NousResearch#26438)
- @kriscolab (PR NousResearch#26926, co-author on salvage commit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder duplicate This issue or pull request already exists P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Type issue in GPT pools

3 participants