Skip to content

feat(agent): passthrough AgentLoopConfig fields via AgentConfig (#32) - #33

Merged
a7garden merged 1 commit into
mainfrom
fix/issue-32-agentconfig-passthrough
Jul 5, 2026
Merged

a7garden merged 1 commit into
mainfrom
fix/issue-32-agentconfig-passthrough

Conversation

@a7garden

@a7garden a7garden commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #32. Adds max_tool_result_bytes, subagent_runner, and subagent_depth to AgentConfig as #[serde(skip, default)] passthroughs, mirroring the existing memory/todo/agent_pool pattern, and threads them through both AgentLoopConfig construction sites in agent.rs.

This unblocks library consumers (e.g. Oxios) that build agents via AgentBuilder/Agent::new from configuring #28 gaps 1 & 3 — previously the fields existed only on AgentLoopConfig, which is constructed internally with no injection point.

Changes

oxi-agent/src/config.rs

  • AgentConfig: +3 #[serde(skip, default)] fields (max_tool_result_bytes: Option<usize>, subagent_runner: Option<Arc<dyn SubagentRunner>>, subagent_depth: u8).
  • Default for AgentConfig: +3 entries (None/None/0).
  • +3 regression tests (defaults, serde-skip forward+backward compat, clone).

oxi-agent/src/agent.rs

  • run_with_channel_inner (site 1, self.config().config.*): threads the 3 fields.
  • run_tokio_stream (site 2, inner.config.*): threads the 3 fields.

oxi-cli/ (4 exhaustive AgentConfig sites → ..Default::default())

  • lib.rs, app/agent_session.rs, app/agent_session_runtime.rs ×2.
  • CLI keeps no-op defaults (subprocess subagent + env-var OXI_SUBAGENT_DEPTH) — behavior unchanged.

Verification

let config = AgentConfig {
    max_tool_result_bytes: Some(8192),
    subagent_runner: Some(Arc::new(my_runner)),
    subagent_depth: 3,
    ..Default::default()
};
let agent = oxi.agent(config).build()?;
  • cargo build --workspace ✅
  • cargo clippy --workspace --all-targets -- -D warnings ✅
  • cargo fmt --all -- --check ✅
  • cargo nextest run -p oxi-agent ✅ (693 passed, +3 new)

Non-breaking

#[serde(skip, default)] means existing serialized AgentConfig values are unaffected; ..Default::default() at consumer construction sites absorbs the new fields.

Add max_tool_result_bytes, subagent_runner, and subagent_depth to
AgentConfig as #[serde(skip, default)] passthroughs, mirroring the
existing memory/todo/agent_pool pattern. Thread them through both
AgentLoopConfig construction sites in agent.rs so library consumers
building agents via AgentBuilder (or Agent::new) can configure gaps 1
and 3 from #28 without reaching AgentLoopConfig internals.

Also update the four exhaustive AgentConfig construction sites in
oxi-cli to use ..Default::default(), absorbing the new fields (CLI
keeps its no-op defaults: subprocess subagent + env-var depth).
a7garden added a commit that referenced this pull request Jul 5, 2026
PR title and body were interpolated via ${{ github.event.pull_request.* }}
directly into run: bash heredocs. PR bodies containing markdown backticks
(e.g. `AgentConfig`, `#[serde(skip, default)]`) triggered command
substitution, and unbalanced parens inside backticks produced an
'unexpected end of file' syntax error → exit code 2 → PR gate failure
on otherwise-correct PRs (e.g. #33).

Move both values to env: indirection (PR_TITLE / PR_BODY). GitHub sets
env values safely without shell evaluation, so the script sees them as
plain strings regardless of markdown content. This also closes a
script-injection vector where a malicious PR title/body could execute
arbitrary commands in the gate job.

Pushed directly to main because pull_request workflows run from the
base branch's workflow file, not the PR head — patching inside a
feature-branch PR would not unblock that same PR.
@a7garden

a7garden commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Re-triggering PR gate after fix c57b73a landed on main (workflow runs from base branch).

@a7garden a7garden closed this Jul 5, 2026
@a7garden a7garden reopened this Jul 5, 2026
@a7garden
a7garden merged commit b619cb3 into main Jul 5, 2026
20 of 22 checks passed
@a7garden
a7garden deleted the fix/issue-32-agentconfig-passthrough branch July 5, 2026 00:43
a7garden added a commit that referenced this pull request Jul 5, 2026
### Added
- AgentConfig passthrough for AgentLoopConfig fields (#32, #33)

### Fixed
- CI: PR gate shell injection via env indirection

### Changed
- 14 cargo major version bumps (#25), 5 RustCrypto reverts (rsa compat)
- actions/checkout v5→v7, upload-artifact v4→v7 (#21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant