Skip to content

fix: SessionDB API signature mismatch in _insert_session_row and append_message#48610

Closed
GauravPatil2515 wants to merge 1 commit into
NousResearch:mainfrom
GauravPatil2515:fix/48531-sessiondb-api-signature-mismatch
Closed

fix: SessionDB API signature mismatch in _insert_session_row and append_message#48610
GauravPatil2515 wants to merge 1 commit into
NousResearch:mainfrom
GauravPatil2515:fix/48531-sessiondb-api-signature-mismatch

Conversation

@GauravPatil2515

Copy link
Copy Markdown

What does this PR do?

Fixes the SessionDB API signature mismatch that causes TypeError at runtime when callers pass keyword arguments that the method signatures don't accept.

Root cause: create_session() forwards **kwargs to _insert_session_row(), and callers like run_agent.py and gateway/session.py pass timestamp to append_message(). Both methods had closed signatures without **kwargs or timestamp, causing:

  • SessionDB._insert_session_row() got an unexpected keyword argument 'cwd'
  • SessionDB.append_message() got an unexpected keyword argument 'timestamp'

Changes:

  1. Added **kwargs to _insert_session_row() signature in hermes_state.py — absorbs extraneous kwargs from callers
  2. Added timestamp: float = None parameter to append_message() in hermes_state.py — preserves original timestamps during session replay; falls back to time.time() when not provided

Related Issue

Fixes #48531

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • hermes_state.py — Added **kwargs to _insert_session_row() and timestamp param to append_message()
  • tests/test_hermes_state.py — Added test_insert_session_row_accepts_kwargs and test_append_message_accepts_timestamp

How to Test

  1. Run python3 -m pytest tests/test_hermes_state.py::TestMessageStorage::test_insert_session_row_accepts_kwargs -v — passes
  2. Run python3 -m pytest tests/test_hermes_state.py::TestMessageStorage::test_append_message_accepts_timestamp -v — passes
  3. Existing tests in TestMessageStorage continue to pass (verified)

Checklist

  • Commit messages follow Conventional Commits
  • PR contains only changes related to this fix
  • Tests pass locally
  • Added tests for the changes
  • Tested on: Ubuntu 24.04 (Python 3.12.3)

…end_message

- Add **kwargs to _insert_session_row to accept caller kwargs like cwd
- Add timestamp parameter to append_message to preserve original timestamps during message replay
- Fixes TypeError when callers pass unexpected keyword arguments
- References issue NousResearch#48531
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jun 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #47253 — this fix is already on main. append_message already accepts timestamp (added by merged #47253) and _insert_session_row already accepts cwd explicitly (merged #20059). The diff hunks here apply at stale line numbers; on current main those exact constructs already carry the parameters, so this is a no-op. The reported runtime errors in #48531 are a release-lag symptom (the running build predates these merges), not a live bug on main. Related: #48531.

@GauravPatil2515

Copy link
Copy Markdown
Author

Closing as duplicate — the fix is already on main (merged via #47253 and #20059). The reported errors were due to release lag, not a live bug.

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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SessionDB API signature mismatch causes runtime errors

2 participants