Skip to content

[FEATURE]: Prepare memory_dir filesystem access for network-backed storage #421

Description

@Shearerbeard

Problem

Filesystem access under memory_dir assumes local disk.

Artifact reads and writes use tokio::fs, but the checks around them don't. Seven .exists() and two .canonicalize() calls in persistence.rs run synchronously inside async fns, blocking a runtime thread instead of the blocking pool. load_session_manifests stats the session dir, lists it, then stats each entry twice, so at the default 20 runs per session that's ~40 synchronous fs calls per turn.

The scratchpad writes intercepted tool output with a blocking std::fs::write on the request thread (scratchpad/wrapper.rs). The comment there says to revisit it "if profiling shows the sync write on the hot path".

persistence_drain_timeout_ms defaults to 2000, sized for sub-millisecond writes. On timeout the run continues with a warning, so a manifest can reference tool output artifacts that haven't landed.

Context

Artifacts hold prior worker evidence and prior tool calls. A follow-up turn needs them, and with no session affinity on a multi-pod deploy they're just not there. Sharing them across pods means putting memory_dir on network storage, where none of these calls are free.

#226 closed on local-disk measurements: 0ms drain across nine sampled iterations. It left the case open for large-artifact workloads that show drain time in a profile.

Notes

Config and single-pod behavior unchanged. #218's instrumentation would show the drain cost.

Activity

  1. self-assigned this
    on Jul 25, 2026
  2. added
    webThis only applies to the outer container of serving web and managing state, not core aura agent code
    agent-loopHigh risk aura core agent loop implementation
    agent-configImplementation in config crates and agent builder, not agent execution.
    on Jul 25, 2026
  3. 28 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-configImplementation in config crates and agent builder, not agent execution.agent-loopHigh risk aura core agent loop implementationwebThis only applies to the outer container of serving web and managing state, not core aura agent code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions