longsession

command
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Command longsession writes long Pi session fixtures and measures a harness's memory with one loaded.

longsession gen -tokens 1000000 -window 5000000 -out DIR
longsession measure -bin pig -dir DIR [-mode rpc|interactive] [-prompts 5] [-profile heap,metrics]
longsession curve -bin pig -out DIR [-from 100000 -to 1000000 -step 100000] [-extra 850000]

gen writes DIR/session.jsonl, DIR/agent (models.json declaring the scripted model with the window, settings.json selecting it) and DIR/meta.json.

measure starts the binary with the fixture's agent directory as PIG_CODING_AGENT_DIR and PI_CODING_AGENT_DIR, a private HOME, and --session on a fresh copy of DIR/session.jsonl (the harness appends its prompts to the session it opens; the copy is removed afterwards), in RPC mode over pipes or in interactive mode in a tmux session. It serves the scripted model itself (an OpenAI-compatible stream that answers "ok" and reports the request's bytes/4 as input tokens) and points the fixture at it. It prints one JSON line per stage to stdout: "loaded" once the harness answers (RPC get_state, or the interactive footer naming the model), then "prompts" after the prompts. Memory is the process tree's Rss, Pss and Private_Dirty from /proc/<pid>/smaps_rollup, in MiB. With -profile, PIG_PROFILE names the kinds and the files land in DIR/profile; the heap profile is written at exit after a forced collection, while the session is still open.

curve runs gen and measure for each size from -from to -to by -step, plus each -extra size, and prints every line.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL