Skip to content

[Feature]: Configurable trajectory flush timeout for reasoning traces #78126

@stevenepalmer

Description

@stevenepalmer

Summary

Make the trajectory flush timeout (time before reasoning traces are flushed to storage) configurable via openclaw.json or environment variables.

Problem to solve

The trajectory flush timeout is currently hardcoded in OpenClaw. This prevents tuning for different use cases:

  • Longer timeouts reduce excessive storage writes for complex, multi-step reasoning tasks
  • Shorter timeouts improve low-latency interactive use

Self-hosted deployments with specific infrastructure constraints cannot adjust this behavior without modifying source code.

Proposed solution

Add a configurable parameter:

  • Config key: trajectoryFlushTimeoutMs in openclaw.json (e.g., under reasoning or traces section)
  • Environment variable fallback: OPENCLAW_TRAJECTORY_FLUSH_TIMEOUT_MS

Default to the current hardcoded value if not set to maintain backward compatibility.

Alternatives considered

None — this is a core configuration knob that should be user-adjustable. Modifying source code directly is not sustainable for self-hosted deployments.

Impact

  • Affected users/systems: Self-hosted OpenClaw operators, users running reasoning-heavy workloads, low-latency interactive use cases
  • Severity: Medium (blocks optimal tuning for specific use cases)
  • Frequency: Always (affects all deployments that need to tune this behavior)
  • Consequence: Excessive storage writes for long reasoning tasks, delayed trace availability for interactive use, extra manual work to patch source code

Evidence/examples

Raised as part of self-hosted OpenClaw deployment where reasoning trace storage behavior needs tuning to specific infrastructure constraints.

Additional information

Must remain backward-compatible with existing config keys. Default value should match the current hardcoded timeout to avoid breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions