Recording Mode
Recording mode captures actual function arguments during runtime so you can replay them in experiments with generated input variations.
When to Use Recording
Use recording mode when:
- Your agent function has complex signatures (WebSocket handlers, callbacks)
- You want to replay real production scenarios
- Testing requires specific argument combinations
- Base inputs alone don't capture the full context
Enabling Recording
From VSCode
In the Experiments view, expand Recording (Advanced) and click Enable Recording.
From Terminal
fluxloop record enable
This automatically:
- Sets
FLUXLOOP_RECORD_ARGS=truein.env - Enables
replay_args.enabledinconfigs/simulation.yaml
Capturing Arguments
-
Ensure recording is enabled (check Experiments view → Recording (Advanced))
-
Run your application as you normally would
-
FluxLoop SDK captures arguments to
recordings/args_recording.jsonl
Each line in the recording file contains:
{
"function": "handle_request",
"args": [],
"kwargs": {"user_id": "123", "message": "Hello"},
"timestamp": "2025-11-11T10:30:00Z"
}
Configuring Replay
Edit configs/simulation.yaml to use recordings:
replay_args:
enabled: true
recording_file: "recordings/args_recording.jsonl"
override_param_path: "kwargs.message" # Where to inject generated inputs
override_param_path
Specifies which field in the recorded arguments should be replaced with generated input variations:
"kwargs.message"– Replacekwargs["message"]"args.0"– Replace first positional argument"data.content"– Replace nested fieldkwargs["data"]["content"]
Running Experiments with Replay
Once configured, run experiments normally:
FluxLoop: Run Experiment
FluxLoop will:
- Load recordings from
recordings/args_recording.jsonl - For each recording, create variations by replacing
override_param_pathwith generated inputs - Execute your agent function with the modified arguments
- Collect traces and results
Viewing Recording Status
From Experiments View
The Recording (Advanced) section shows:
- Recording files from
recordings/directory - Click any file to open and inspect
From Terminal
fluxloop record status
Disabling Recording
From VSCode
In the Experiments view, expand Recording (Advanced) and click Disable Recording.
From Terminal
fluxloop record disable
This:
- Sets
FLUXLOOP_RECORD_ARGS=falsein.env - Optionally disables
replay_argsin simulation config
Environment Considerations
Recording and replay use the same Python environment as experiments.
Ensure Packages Are Available
-
Check environment:
FluxLoop: Show Environment Info -
Ensure SDK is installed:
source .venv/bin/activate
pip install fluxloop -
Verify with Doctor:
FluxLoop: Run Doctor
Using Different Environments
If you recorded arguments in one environment but want to replay in another:
- Ensure both environments have compatible SDK versions
- Recording file paths are relative to project root
- Check that
override_param_pathmatches your agent's signature in both environments
Example Workflow
-
Enable recording: In Experiments view → Recording (Advanced) → Enable Recording
-
Run your app and capture arguments:
python app/main.py
# Interact with your agent to generate diverse argument patterns -
Check recordings:
cat recordings/args_recording.jsonl -
Configure replay in
configs/simulation.yaml:replay_args:
enabled: true
recording_file: "recordings/args_recording.jsonl"
override_param_path: "kwargs.prompt" -
Generate inputs:
FluxLoop: Generate Inputs -
Run experiment:
FluxLoop: Run Experiment -
Disable recording when done: In Experiments view → Recording (Advanced) → Disable Recording
Troubleshooting
Arguments Not Being Recorded
- Verify
.envcontainsFLUXLOOP_RECORD_ARGS=true - Check that FluxLoop SDK is imported in your code
- Ensure the target function is decorated with
@fluxloop.trace() - Review application logs for SDK initialization messages
Replay Fails During Experiment
-
Check
override_param_pathmatches your function signature -
Verify recording file exists:
ls recordings/args_recording.jsonl -
Inspect recording format:
head -1 recordings/args_recording.jsonl | python -m json.tool -
Run with verbose logging:
fluxloop run experiment --verbose
Wrong Arguments Replayed
- Ensure
override_param_pathpoints to the correct field - Check that recordings match your current agent signature
- Clear old recordings if agent signature changed:
rm recordings/args_recording.jsonl
fluxloop record enable
# Re-record with updated signature