Skip to content

feat: Pi 1.7.0 harness row with settings writer and log parser - #280

Merged
popodidi merged 2 commits into
mainfrom
axe/task-2375--work
Dec 1, 2026
Merged

popodidi merged 2 commits into
mainfrom
axe/task-2375--work

Conversation

@popodidi

@popodidi popodidi commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Plan row P1 (store doc harvis/research/20261201-open-harness-runtimes.md, sections 3, 5, 6 and 7; task 2375).

What

  • pi harness row (@earendil-works/pi-coding-agent 1.7.0, Harness::package). Launch and resume both run pi --mode json -p --no-approve --offline --session-id {session_id} {prompt}:
    • --session-id creates the session on the first run and resumes it after.
    • --no-approve ignores Pi files in the run folder.
    • --offline skips the pi.dev update check and catalog refresh, since axe pins the version.
  • Env, providers and arguments: PI_CODING_AGENT_DIR=<home>/agent. deepseek and openrouter now list pi. Bots get --append-system-prompt {system_prompt_file}. Models and effort go in as --model provider/model and --thinking {effort}.
  • Settings writer (ConfigFile::Pi): writes agent/settings.json with defaultProvider and defaultModel of the first held provider, never a key. It uses the same create/login/drop/load hooks as OpenCode.
  • LogFormat::Pi:
    • Usage: the assistant message_end lines, one run's own calls (per_run), keyed by the provider/model the log names, using Pi's own cost. Reasoning is already in output and is also counted as thinking.
    • Failures: read from errorMessage (status prefix 401: or 401 ). 401 is auth_invalid, 402 is out_of_credit, 429/5xx is provider_unavailable. A later successful call clears an earlier failure.
    • Activity: read from the log.
    • Retention: prunes JSONL transcripts under agent/sessions/<cwd>/<time>_<id>.jsonl.
  • Pi exits 0 after a failed model call. LogFormat::exit_failure reads Pi's failure on a zero exit too, for task runs (dispatch.rs) and bot runs (bots.rs). Other CLIs are unchanged and are still classified only on non-zero exits.
  • Telegram: Pi uses the shared onboarding (Set up Pi, provider step, key form, Add provider). There is no Pi-only screen. The tool buttons now wrap three to a row, so Pi gets a second row, which keeps the 3-per-row keyboard rule.
  • Docs: concepts/runtimes.md, concepts/routines-bots-goals.md, guides/runtimes-from-telegram.md and reference/config.md.
  • No schema change and no web change.

Verify

  • CI-matching at a70c69d:
    • cargo fmt --check
    • clippy -D warnings
    • cargo test --locked
    • ts_bindings
    • no-default-features clippy and test
    • web npm ci && npm run build
    • embed-ui clippy, build and test
    • check_doc_links
  • New tests:
    • golden logs for fixtures/pi/ (real Pi 1.7.0 output against a local mock: DeepSeek run, resume with a tool call, thinking, OpenRouter run and resume, 401, 402, 429)
    • pi_runs_are_per_run_and_name_their_provider_model
    • a_zero_exit_fails_only_for_pi
    • a_pi_runtime_writes_its_settings_from_its_keys
    • pi_transcripts_are_found_in_the_agent_directory
    • pi_settings_name_the_first_provider_and_its_default_model
    • pi_sets_up_like_opencode
  • Scratch end-to-end: real server, node and stub Telegram, real Pi 1.7.0, mock provider, dummy keys, scratch HOME.
    • Onboarding: a wrong key is dropped ("Nothing was added"). A good key gives "Pi 1 is ready with DeepSeek (deepseek-flash)". Add provider OpenRouter works.
    • A task run and its resume, and a bot run and its resume, each stayed in one session. The bot's system prompt reached the model.
    • Usage is known under deepseek/deepseek-flash with per-run deltas (totals 176 -> 352).
    • Nothing was written to HOME.

🤖 Generated with Claude Code

haojr and others added 2 commits December 1, 2026 16:28
- pi row (@earendil-works/pi-coding-agent 1.7.0): pi --mode json -p
  --no-approve --offline --session-id {session_id} for launch and resume,
  PI_CODING_AGENT_DIR=<home>/agent, provider-table logins (deepseek and
  openrouter both list pi), --append-system-prompt for bots, --model and
  --thinking
- ConfigFile::Pi writes agent/settings.json (defaultProvider and
  defaultModel of the first held provider, no key)
- LogFormat::Pi: per-run usage from assistant message_end (provider/model
  named in the log, Pi's cost), 401/402/429 failures from errorMessage,
  activity, and JSONL transcript retention (agent/sessions)
- Pi exits 0 after a failed model call: LogFormat::exit_failure reads its
  failure on a zero exit too (task and bot runs)
- Telegram: Set up Pi through the shared provider onboarding; tool buttons
  three a row
- Fixtures captured from Pi 1.7.0 against a local mock provider

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/axe-telegram/src/telegram.rs
@popodidi
popodidi merged commit cc86061 into main Dec 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant