Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/autoresearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ specification copied from an untrusted source. The workspace must be clean at
startup. Rejected iterations are restored to their checkpoint; ignored
configuration/state files are restored to their pre-iteration contents, and
untracked files created by that iteration are removed. Build output under
`target/` is treated as disposable process state. Run autoresearch in a
dedicated worktree when experimenting with valuable local files.
`target/`, dependency trees, and other volatile build roots are treated as
disposable process state. The remaining ignored snapshot is disk-backed and
bounded to 16 MiB per file and 64 MiB total. Run autoresearch in a dedicated
worktree when experimenting with valuable local files.

Baseline validation and metric commands must not modify tracked files, change
the branch, or move `HEAD`; the run aborts and restores the baseline if they
do. The controller scrubs secret-bearing environment variables from its
subprocesses and makes its acceptance commit with repository hooks disabled.
The restricted experiment agent receives repository instructions but not
`USER.md` or `MEMORY.md`.

If `ledger_path` is inside the workspace, it must be Git-ignored; an external
ledger path is also supported. This keeps the durable ledger from becoming an
Expand Down
10 changes: 10 additions & 0 deletions src/agent_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ pub struct StateBody {
pub engine: String,
pub mode: String,
pub cost_usd: f64,
/// False means the displayed cost excludes calls whose model price is
/// unknown.
pub pricing_complete: bool,
pub unpriced_call_count: usize,
pub total_tokens: usize,
pub call_count: usize,
/// Input tokens of the most recent model call — what the agent actually
Expand Down Expand Up @@ -116,6 +120,8 @@ pub async fn build_state(runner: &AgentRunner, chat_id: &str) -> StateBody {
engine: "rx4".into(),
mode: mode_name(&runner.get_mode()).into(),
cost_usd: summary.total_cost,
pricing_complete: summary.pricing_complete,
unpriced_call_count: summary.unpriced_call_count,
total_tokens: summary.total_tokens,
call_count: summary.call_count,
context_tokens,
Expand Down Expand Up @@ -621,6 +627,8 @@ mod tests {
engine: "rx4".into(),
mode: "auto".into(),
cost_usd: 0.25,
pricing_complete: true,
unpriced_call_count: 0,
total_tokens: 1234,
call_count: 3,
context_tokens: 8000,
Expand All @@ -636,6 +644,8 @@ mod tests {
"engine",
"mode",
"cost_usd",
"pricing_complete",
"unpriced_call_count",
"total_tokens",
"call_count",
"context_tokens",
Expand Down
Loading
Loading