Skip to content

0.35: Remodel around dsh trajectory feature. - #66

Merged
MathisWellmann merged 16 commits into
mainfrom
remodel
Aug 31, 2026
Merged

0.35: Remodel around dsh trajectory feature.#66
MathisWellmann merged 16 commits into
mainfrom
remodel

Conversation

@MathisWellmann

@MathisWellmann MathisWellmann commented Aug 30, 2026

Copy link
Copy Markdown
Owner
  • Include system_prompt method in trait EvolutionAgent and use rig from git directly to get access to the system prompt.
  • remove system_prompt from DshSessiion as its now in EvolutionTrace
  • remove public EvolutionTrace::render method as its not useful.
  • Some file and module refactors.
  • Add provider method to EvolutionAgent and remove it from DshHeader to instead put it into EvolutionTrace.
  • remodel agent_builder_from_env into agent_from_env, remove init_agent_from_env
  • remove model from DshSession and put it into EvolutionTrace, wiring it through the EvolutionTrace trait.

@MathisWellmann MathisWellmann self-assigned this Aug 30, 2026
@github-actions

Copy link
Copy Markdown

Summary

The PR replaces the Agent type alias with a wrapper struct carrying the provider base URL, moves the system prompt/provider from DshSession into EvolutionTrace, reorganizes inference code into an inference/ module, switches rig to a git dependency, and updates all examples to the new API. One call site was not converted and breaks the build.

Issues

  • symbiont/benches/batch_throughput.rs:614-619 — Blocker. agent_from_env now returns a built symbiont::Agent (previously AgentBuilder), but the benchmark still chains .max_tokens(MAX_OUTPUT_TOKENS).build() on that result. Those methods exist only on the rig AgentBuilder; the returned Agent (and the rig_agent::Agent it derefs to) has neither, so the bench target no longer compiles under cargo bench / cargo check --all-targets. Build the agent via symbiont::agent_builder(...) with .max_tokens(MAX_OUTPUT_TOKENS).build() and wrap with Agent::new, as the examples in this same diff do.

@github-actions

Copy link
Copy Markdown

Summary

The PR wraps rig_agent::Agent in a new symbiont::Agent (carrying provider/model), moves provider/model/system prompt into EvolutionTrace, restructures inference* into an inference/ module, and drops the trace's public render/JSONL APIs. Solid direction, but it ships a broken doc test and a silent break of persisted-trace deserialization.

Issues

  • symbiont/src/dsh/mod.rs:65 — blocker. The module's no_run example still calls DshSession::builder().provider("openrouter").model("moonshotai/kimi-k3"), but the provider/model/system_prompt fields were removed from DshSession in symbiont/src/dsh/export.rs. Doc tests compile even when no_run, so cargo test --features dsh-export (or --all-features) fails to build; the "Fields the session takes from the caller" bullet list (mod.rs:28) is stale the same way. Remove the two builder calls and reword the bullets to say these fields now come from the trace.
  • symbiont/src/evolution_trace.rs:51,55,63 — major. The new provider, model, and system_prompt fields have no #[serde(default)], so Deserialize now rejects every trace persisted by 0.33/0.34, and the serde_round_trip test that guarded "a host can read a persisted trace back for offline analysis" was deleted with no replacement. Add #[serde(default)] to the three fields (and keep a round-trip test) or explicitly document the format break.

@github-actions

Copy link
Copy Markdown

Summary

PR replaces the rig_agent::Agent type alias with a new symbiont::Agent wrapper that records provider URL and model, moves the system prompt/provider/model from DshSession onto EvolutionTrace, restructures inference.rs into an inference/ module (with error classification moved to inference_utils.rs), and switches rig to a git fork. The migration is complete and internally consistent across crate, examples, and tests; remaining findings are a doc/signature mismatch and an untested new code path.

Issues

  • symbiont/src/lib.rs (~line 144, also the AgentBuilder alias docs and inference/agent_builder.rs) — Major: the doc comments document Agent::new(built, base_url) with two arguments, but the new constructor takes three (inner, provider, model); copy-pasted examples fail to compile. Fix: show the three-argument form, passing model as well.
  • symbiont/src/inference/agent_builder.rs (new test init_agent_carries_the_base_url_as_provider) — Major: the new Agent::system_prompt() path (reading rig's run_spec().preamble, which populates EvolutionTrace.system_prompt and the dsh session header's system field) is untested; the only new unit test asserts provider(). A wrong or empty preamble would make every exported session carry an empty system prompt with no test to catch it. Fix: assert the expected prompt in that test (or against a trace built by the runtime).

@github-actions

Copy link
Copy Markdown

Summary

Bumps symbiont 0.33→0.35: replaces the Agent type alias with a struct that carries provider/model, moves provider/model/system-prompt from DshSession onto EvolutionTrace, derives EvolveInfo::usage() from the trace, and folds inference helpers into a inference/ module. The refactor is internally consistent — all call sites updated, usage-sum equivalence verified, no dangling references to the removed render/write_jsonl/to_json_pretty or the old *_from_env helpers. No functional blocker found.

Issues

  • symbiont/src/system_prompt.rs:209 — Major (doc). The system_prompt function still documents that "EvolutionTrace omits the preamble by design," which this diff makes false: it adds system_prompt to EvolutionTrace and records the agent's preamble in every lane. The diff deliberately removed the identical "absent by design / store it beside the traces" note from evolution_trace.rs but left this one, so the user-facing API doc now states the opposite of the new behavior. Fix: update system_prompt.rs to say the trace now records the preamble (or that the free function is for reproducing it independently).

@github-actions

Copy link
Copy Markdown

Summary

The PR replaces the Agent type alias with a wrapper that carries provider/model, moves system prompt/provider/model from DshSession onto EvolutionTrace (with serde(default) back-compat), renames init_agent_from_env/agent_builder_from_env to agent_from_env/init_agent, and consolidates inference code into an inference module. Verified: EvolutionTrace::usage() still sums every attempt that reached the model (matching the removed runtime accumulator), no stale call sites of the removed APIs remain, and the dsh-export feature-gating in the doc test is valid. The remaining problems are public docs that now contradict the new behavior.

Issues

  • symbiont/src/system_prompt.rs:210, major — the doc still states EvolutionTrace "omits the preamble by design" and that the caller must fetch system_prompt() separately (the old DshSession contract), but the trace now records the preamble and DshSession no longer accepts it; a host following this doc misreads the export contract. Rewrite the paragraph to say the trace carries the preamble.
  • symbiont/src/lib.rs:149, major — the Agent doc shows the two-argument call Agent::new(builder.tool(..).build(), base_url), but Agent::new requires a third model argument, and the AgentBuilder doc (line ~190) repeats "passing the same base_url" without it; a host copy-pasting the documented wrapping step does not compile. Show the three-argument call in both places.

@MathisWellmann
MathisWellmann merged commit ab1d367 into main Aug 31, 2026
6 checks passed
@MathisWellmann
MathisWellmann deleted the remodel branch August 31, 2026 01:03
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