tinyhumansai/openhuman · error

Missing required parameter 'session_id'

Error message

Missing required parameter 'session_id'

What it means

insert_sql_record requires 'session_id' to attribute the conversation row; this fires at the top of the parameter-extraction block when args lack a 'session_id' string, before role/content are read or anything is persisted.

Source

Thrown at src/openhuman/tools/impl/system/insert_sql_record.rs:78

                },
                "lesson": {
                    "type": "string",
                    "description": "Optional distilled lesson extracted from this exchange."
                }
            }
        })
    }

    fn permission_level(&self) -> PermissionLevel {
        PermissionLevel::Write
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        // ── Parameter extraction ────────────────────────────────────────────
        let session_id = args
            .get("session_id")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing required parameter 'session_id'"))?;

        let role = args
            .get("role")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing required parameter 'role'"))?;

        let content = args
            .get("content")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing required parameter 'content'"))?;

        let lesson = args.get("lesson").and_then(|v| v.as_str());

        // ── Validation ──────────────────────────────────────────────────────
        if !VALID_ROLES.contains(&role) {
            return Ok(ToolResult::error(format!(
                "Invalid role '{role}'. Must be one of: user, assistant, tool."
            )));

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass the current "session_id" string with the record arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/system/insert_sql_record.rs:78 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/5f1decd913794cc3. Report an issue: GitHub.