🤖 perf: cut SSH stream startup remote I/O - #3805
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa99f9e64c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the P2 by capping remote agent/skill descriptor reads with a sliding-window concurrency helper ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2ee14f5ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the shared-cap concern by adding a per- |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 505db0d947
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the three P2s:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57019cdb15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest three P2s:
|
|
@codex review Rebased onto latest |
5199d7c to
06ebb80
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06ebb809f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the remaining-deadline concern: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24b4f0d9fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed: SSH2 connection acquisition now passes the remaining deadline as both |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 442b36e785
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd23e8a33d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bd23e8a to
49cb541
Compare
|
@codex review Simplified the PR to the categorical startup wins only (parallel context loads + AGENTS.md reuse + overlapped post-context setup). Removed the contested full-lifetime remote session semaphore / SSH2 accounting layers after they ballooned scope and risked starving MCP/PTY sessions. Net LoC is negative vs main. |
|
Resolved the two leftover threads about RemoteRuntime exec-session budgeting / PTY accounting as no longer applicable: that full-lifetime session-limiter approach was removed from this PR after review thrash. The PR now only overlaps independent stream-context loads and reuses AGENTS.md sources for tool instructions. @codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Reuse AGENTS.md sources for tool instructions and parallelize independent stream-context/instruction loads so pre-stream preparation is not serialized across remote round-trips.
|
@codex review Rebased onto latest main and kept the PR as a single net-negative LoC commit focused on overlapping stream-context loads + AGENTS.md reuse. |
f2b0e9f to
8115ac4
Compare
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Cut SSH stream-startup latency by eliminating duplicate AGENTS.md scans and overlapping independent pre-stream context work. Net LoC is negative versus
main.Background
Slow stream starts on SSH showed most time in
buildStreamSystemContextMs, with a second AGENTS.md pass for tool instructions. Each remote probe is ~80–100ms, so sequential context assembly added multi-second delay before the provider stream started.Implementation
buildStreamSystemContext.instructionSourcesand reuse them viatoolInstructionsFromSources(no second remote AGENTS.md scan).aiService.Intentionally not included after review thrash: full-lifetime remote exec session semaphores / SSH2 connection accounting (risked starving long-lived MCP servers and interactive PTYs).
Validation
bun teston stream context / system message / instruction files / aiService / agent defs / skillsmake typecheckRisks
Generated with
mux• Model:xai:grok-4.5• Thinking:high• Cost:$3.88