[Bug Hunt Cycle 2 Batch 3] CRITICAL: Inconsistent JSON validation between host and container execution #7064

Open
opened 2026-04-10 07:28:07 +00:00 by HAL9000 · 1 comment
Owner

Bug Report: JSON Serialization Inconsistency — Tool Execution Environment Disparity

Severity Assessment

  • Impact: Tools may behave differently between execution environments, leading to inconsistent validation and potential data corruption
  • Likelihood: High - affects all tools with NaN, infinity, or other edge-case numeric values
  • Priority: Critical

Location

  • File: src/cleveragents/tool/runner.py
  • Function: ToolRunner.execute()
  • Lines: 413 (container path) vs 463 (host path)

Description

The tool execution pipeline applies different JSON serialization validation rules depending on the execution environment. Container-routed tools use strict RFC 7159 compliance (allow_nan=False) while host-routed tools use Python's default behavior (allow_nan=True).

Evidence

# Container path (line 413):
json.dumps(inputs, allow_nan=False)

# Host path (line 463): 
json.dumps(inputs)  # defaults to allow_nan=True

Expected Behavior

All tool executions should apply consistent input validation regardless of execution environment.

Actual Behavior

  • Container execution rejects inputs with NaN/infinity values
  • Host execution accepts the same inputs
  • Same tool with same inputs produces different validation results

Suggested Fix

Standardize on one validation approach across both execution paths. Recommend using allow_nan=False consistently for RFC 7159 compliance.

Category

consistency

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_, and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter
Worker Type: Module Scanner

## Bug Report: JSON Serialization Inconsistency — Tool Execution Environment Disparity ### Severity Assessment - **Impact**: Tools may behave differently between execution environments, leading to inconsistent validation and potential data corruption - **Likelihood**: High - affects all tools with NaN, infinity, or other edge-case numeric values - **Priority**: Critical ### Location - **File**: `src/cleveragents/tool/runner.py` - **Function**: `ToolRunner.execute()` - **Lines**: 413 (container path) vs 463 (host path) ### Description The tool execution pipeline applies different JSON serialization validation rules depending on the execution environment. Container-routed tools use strict RFC 7159 compliance (`allow_nan=False`) while host-routed tools use Python's default behavior (`allow_nan=True`). ### Evidence ```python # Container path (line 413): json.dumps(inputs, allow_nan=False) # Host path (line 463): json.dumps(inputs) # defaults to allow_nan=True ``` ### Expected Behavior All tool executions should apply consistent input validation regardless of execution environment. ### Actual Behavior - Container execution rejects inputs with NaN/infinity values - Host execution accepts the same inputs - Same tool with same inputs produces different validation results ### Suggested Fix Standardize on one validation approach across both execution paths. Recommend using `allow_nan=False` consistently for RFC 7159 compliance. ### Category consistency ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter **Worker Type**: Module Scanner
Author
Owner

Verified — Critical bug: inconsistent JSON validation between host and container execution. MoSCoW: Must-have. Priority: Critical.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Critical bug: inconsistent JSON validation between host and container execution. MoSCoW: Must-have. Priority: Critical. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#7064
No description provided.