Skip to content

chore(life): bump aiOS for BRO-422 turn middleware - #450

Merged
broomva merged 3 commits into
mainfrom
bro-422-turn-middleware
Apr 3, 2026
Merged

broomva merged 3 commits into
mainfrom
bro-422-turn-middleware

Conversation

@broomva

@broomva broomva commented Apr 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • update the aiOS submodule pointer to include the BRO-422 turn middleware chain implementation
  • align the Life workspace with the canonical runtime change shipped in broomva/aiOS#4

Validation

  • cargo fmt --all
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

Depends on: broomva/aiOS#4
Linear: BRO-422

Summary by CodeRabbit

  • Chores
    • Updated subproject dependencies (aiOS, arcan, and lago) to the latest versions.

broomva and others added 2 commits April 2, 2026 13:53
LAGO_ARCHITECTURE.md: reflect completed work (MEMORY.md, prompt cache,
memory tools, /search, session resume, E2E tests, embedding provider).

Submodule updates:
- arcan: BRO-388 (embedding provider), BRO-390 (/search), E2E tests, CI fixes
- lago: BRO-382 (Lance embedding column + vector_search)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 8bbef783ce6b
@linear

linear Bot commented Apr 2, 2026

Copy link
Copy Markdown
BRO-422 Turn Middleware Chain for Agent Loop

What

Define a TurnMiddleware trait in arcan-core and compose a middleware chain in arcand that processes every agent turn. Inspired by DeerFlow's 12-middleware chain architecture (thread data → uploads → sandbox lifecycle → dangling tool call recovery → guardrails → summarization → todo list → title generation → memory → image viewing → subagent limits → clarification).

This is the same pattern as HTTP middleware (tower/axum) applied to agent turns — cleanly separates cross-cutting concerns from core agent logic.

Why

Arcan's 8-phase tick lifecycle has structure, but cross-cutting concerns (guardrails, compression, loop detection, memory injection) are either hardwired into the loop or missing entirely. A middleware chain makes the pipeline extensible without touching the core loop. This is the single most important architectural change — it enables all Phase B and C features to plug in cleanly.

Implementation

Target crate: arcan-core

#[async_trait]
pub trait TurnMiddleware: Send + Sync {
    async fn process(
        &self,
        ctx: &mut TurnContext,
        next: &dyn TurnMiddleware,
    ) -> Result<TurnResponse>;
}
  • Define TurnContext carrying session state, pending tool calls, budget info
  • Compose chain in arcand config (ordered list of middleware)
  • Initial middleware: passthrough (no-op) to prove the chain works
  • Subsequent issues add real middleware (loop detection, compression, guardrails)

Acceptance Criteria

  • TurnMiddleware trait defined with process method
  • TurnContext type carries mutable session state through the chain
  • Middleware chain composes N middleware in order
  • Existing agent loop refactored to run through chain (no behavior change)
  • At least one test showing middleware intercepts and modifies a turn
  • No performance regression on existing benchmarks

Source

DeerFlow — 12-middleware chain architecture (§1 in research doc)

@coderabbitai

coderabbitai Bot commented Apr 2, 2026 •

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 014cab7c-551d-4ae5-a695-3d8b5f6aa277

📥 Commits

Reviewing files that changed from the base of the PR and between 39759bd and 5407809.

📒 Files selected for processing (3)
  • aiOS
  • arcan
  • lago

📝 Walkthrough

Walkthrough

Three subproject/submodule pointers are updated to newer commits: aiOS, arcan, and lago each receive commit hash updates without visible code or logic changes in the diff.

Changes

Cohort / File(s) Summary
Subproject Pointer Updates
aiOS, arcan, lago
Three subproject references updated to newer commits: aiOS (b8d2b31 → c8e55cc), arcan (543f709 → 4a62045), lago (a1ae71a → f3e59c5).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three pointers did hop and dance,
To commits fresh and new at glance,
aiOS, arcan, lago unite,
With hashes pointing ever right!
Subprojects skip ahead with glee,
Updated code for all to see! 🌟


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@broomva
broomva merged commit 99c54f4 into main Apr 3, 2026
1 check passed
broomva added a commit that referenced this pull request Apr 5, 2026
chore(life): bump aiOS for BRO-422 turn middleware
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