Skip to content

Codex/campus relay fast path - #6917

Open
chemyibinjiang wants to merge 82 commits into
block:mainfrom
chemyibinjiang:codex/campus-relay-fast-path
Open

Codex/campus relay fast path#6917
chemyibinjiang wants to merge 82 commits into
block:mainfrom
chemyibinjiang:codex/campus-relay-fast-path

Conversation

@chemyibinjiang

Copy link
Copy Markdown

Summary

Related issue

Testing

joelbrilliant and others added 30 commits August 10, 2026 19:02
Channel to ACP session bindings are in-memory only, so every harness
restart starts a cold conversation even against an agent that advertises
`loadSession`. This persists the mapping as a small JSON sidecar under the
process data directory, keyed by (agent command identity, agent args,
channel id) so different agent binaries and profiles never share bindings.
Heartbeats stay ephemeral and are never stored.

The store is shared between processes, so a process-local cache alone is
unsafe: two buzz-acp processes with the same agent identity would clobber
each other. Every read and mutation takes a sibling lockfile, reloads the
on-disk map under that lock, then writes atomically.

Removal is conditional on purpose. After a failed `session/load` another
process may already have written a newer session for the same channel, so
`remove_if_equals` only drops the binding it actually failed to load. A
key-only remove would delete the fresher one.

Signed-off-by: joelbrilliant <joelbrilliant1@gmail.com>
`session/load` failure handling treated every error the same: drop the
stored binding and fall through to `session/new`. Only a JSON-RPC error
response actually proves the session is gone.

A timeout, transport failure or malformed response does not. The provider
may have loaded the session and still hold it open, so clearing the binding
and creating a new session forks hidden provider state: two live sessions
for one channel, one of them unreachable and never cleaned up.

Clear only on `AcpError::AgentError`. Everything else keeps the mapping and
logs the indeterminate outcome. That is self-healing rather than sticky: a
provider that has genuinely lost the session answers `AgentError` on a later
attempt, and that clears it then.

Raised by @OpenSpek while validating restart-durable sessions on Windows.

Signed-off-by: joelbrilliant <joelbrilliant1@gmail.com>
Signed-off-by: joelbrilliant <joelbrilliant1@gmail.com>
Deliver legacy standing context once after a successful ACP prompt and
track live-session event delivery so later thread and DM prompts send
only deltas. Fence successful native steer acknowledgements by ACP
session identity across task-result races.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Distinguish history omitted because it was delivered earlier from a
trigger-only fetch, and add regression coverage for channel delivery
commit timing and stale in-flight steer acknowledgements.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
LinHuangxmu and others added 29 commits August 21, 2026 12:35
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin_Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Lin Huang <huanglin1757@stu.xmu.edu.cn>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
Signed-off-by: Yibin Jiang <44966246+chemyibinjiang@users.noreply.github.com>
@chemyibinjiang
chemyibinjiang requested a review from a team as a code owner August 27, 2026 02:48
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.

4 participants