Skip to content

[Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings - #52

Merged
KooshaPari merged 1 commit into
masterfrom
instinct/ci-workflow-env
Oct 12, 2026
Merged

KooshaPari merged 1 commit into
masterfrom
instinct/ci-workflow-env

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Authored by Instinct

OpenRouter emits buffered final events after transport EOF. Polling the underlying non-fused unfold stream again then panics. Fuse that transport so pending events drain safely and later polls stay terminal; cover both empty and nonempty unfold streams.

Also merge duplicate workflow-level env mappings in CI, Windows Smoke, and iOS TestFlight. Actionlint reproduced all three duplicate-key failures before the fix and passes afterward.

Validation: all 32 jcode-provider-openrouter tests pass; actionlint passes for all three workflows; git diff --check passes. No shared daemon restart or branch consolidation.

Closes #53.

Negative control: removing fuse reproduces the exact unfold.rs:108 panic; restoring fuse passes.

tx-agent: codex
tx-validated: test
tx-task: drift-panic-jcode-ci
Copilot AI balanced review requested due to automatic review settings October 12, 2026 23:39
@codeant-ai

codeant-ai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR a115961 Oct 12, 2026 · 23:39 23:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e05fdc85-b3a7-4570-a47d-7357bee72edd
📥 Commits

Reviewing files that changed from the base of the PR and between dcb61e7 and a115961.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • .github/workflows/ios-testflight.yml
  • .github/workflows/windows-smoke.yml
  • crates/jcode-provider-openrouter/src/stream.rs
  • crates/jcode-provider-openrouter/src/stream_eof_tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: TypeScript SDK
  • GitHub Check: Setup Friction Eval (Linux installer)
  • GitHub Check: Build & Test (macos-latest)
  • GitHub Check: Build & Test (windows-latest)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Kilo Code Review
⚠️ CI failures not shown inline (14)

GitHub Actions: Require Linked Issue / 0_Require Linked Issue.txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   script: const pr = context.payload.pull_request;
if (!pr) {
  core.info('No pull_request payload; skipping.');
  return;
}
const owner = context.repo.owner;
const repo = context.repo.repo;
const text = `${pr.title || ''}\n\n${pr.body || ''}`;
// Collect candidate issue numbers that belong to THIS repo.
const candidates = new Set();
// Full issue URLs: https://github.com/owner/repo/issues/123
const urlRe = /https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+)\/issues\/(\d+)/gi;
for (const m of text.matchAll(urlRe)) {
  if (m[1].toLowerCase() === owner.toLowerCase() &&
      m[2].toLowerCase() === repo.toLowerCase()) {
    candidates.add(Number(m[3]));
  }
}
// owner/repo#123 or bare #123 (bare assumed to be this repo).
const refRe = /(?:([\w.-]+)\/([\w.-]+))?#(\d+)/g;
for (const m of text.matchAll(refRe)) {
  const refOwner = m[1];
  const refRepo = m[2];
  const num = Number(m[3]);
  if (!refOwner && !refRepo) {
    candidates.add(num); // bare #123 -> this repo
  } else if (refOwner?.toLowerCase() === owner.toLowerCase() &&
             refRepo?.toLowerCase() === repo.toLowerCase()) {
    candidates.add(num);
  }
}
// Issues linked via the Development sidebar (closing references).
try {
  const query = `query($owner:String!, $repo:String!, $number:Int!) {
    repository(owner:$owner, name:$repo) {
      pullRequest(number:$number) {
        closingIssuesReferences(first: 10) { nodes { number } }
      }
    }
  }`;
  const result = await github.graphql(query, { owner, repo, number: pr.number });
  const nodes = result?.repository?.pullRequest?.closingIssuesReferences?.nodes || [];
  for (const n of nodes) candidates.add(Number(n.number));
} catch (err) {
  core.warning(`Could not query closing issue references: ${err}`);
}
// Verify at least one candidate is a real issue (not a PR, not this PR).
let linkedIssue = null;
for (const num of candidates) {
  if (num === pr.number) continue;
  try {
    const { data } = await git...

GitHub Actions: Require Linked Issue / Require Linked Issue: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   script: const pr = context.payload.pull_request;
if (!pr) {
  core.info('No pull_request payload; skipping.');
  return;
}
const owner = context.repo.owner;
const repo = context.repo.repo;
const text = `${pr.title || ''}\n\n${pr.body || ''}`;
// Collect candidate issue numbers that belong to THIS repo.
const candidates = new Set();
// Full issue URLs: https://github.com/owner/repo/issues/123
const urlRe = /https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+)\/issues\/(\d+)/gi;
for (const m of text.matchAll(urlRe)) {
  if (m[1].toLowerCase() === owner.toLowerCase() &&
      m[2].toLowerCase() === repo.toLowerCase()) {
    candidates.add(Number(m[3]));
  }
}
// owner/repo#123 or bare #123 (bare assumed to be this repo).
const refRe = /(?:([\w.-]+)\/([\w.-]+))?#(\d+)/g;
for (const m of text.matchAll(refRe)) {
  const refOwner = m[1];
  const refRepo = m[2];
  const num = Number(m[3]);
  if (!refOwner && !refRepo) {
    candidates.add(num); // bare #123 -> this repo
  } else if (refOwner?.toLowerCase() === owner.toLowerCase() &&
             refRepo?.toLowerCase() === repo.toLowerCase()) {
    candidates.add(num);
  }
}
// Issues linked via the Development sidebar (closing references).
try {
  const query = `query($owner:String!, $repo:String!, $number:Int!) {
    repository(owner:$owner, name:$repo) {
      pullRequest(number:$number) {
        closingIssuesReferences(first: 10) { nodes { number } }
      }
    }
  }`;
  const result = await github.graphql(query, { owner, repo, number: pr.number });
  const nodes = result?.repository?.pullRequest?.closingIssuesReferences?.nodes || [];
  for (const n of nodes) candidates.add(Number(n.number));
} catch (err) {
  core.warning(`Could not query closing issue references: ${err}`);
}
// Verify at least one candidate is a real issue (not a PR, not this PR).
let linkedIssue = null;
for (const num of candidates) {
  if (num === pr.number) continue;
  try {
    const { data } = await git...

GitHub Actions: CI / 0_Format.txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run cargo fmt --all -- --check
 �[36;1mcargo fmt --all -- --check�[0m
 shell: /usr/bin/bash -e {0}
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   CARGO_HOME: /home/runner/.cargo
   CARGO_INCREMENTAL: 0
 ##[endgroup]
 Diff in /home/runner/work/Jcode/Jcode/benches/startup.rs:15:
  //! cargo bench --bench startup -- --save-baseline before
  //! ```
 -use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
 +use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
  use std::sync::atomic::{AtomicUsize, Ordering};
  // ---------------------------------------------------------------------------
 Diff in /home/runner/work/Jcode/Jcode/crates/jcode-app-core/src/agent/cache_vectors.rs:37:
          fast_mode: bool,
      ) {
          let snapshot = snapshot_current_state(
 -            &system_prompt,                                        // system_prompt
 -            &tools.iter().map(|t| t.input_schema.clone()).collect::<Vec<_>>(), // tool_schemas
 -            &(),                                                   // cache_control
 -            per_tool_hashes(tools),                                // per_tool_hashes
 -            model.to_string(),                                     // model
 -            fast_mode,                                             // fast_mode
 -            String::new(),                                         // global_cache_strategy
 -            Vec::new(),                                            // betas
 -            false,                                                 // auto_mode_active
 -            false,                                                 // is_using_overage
 -            false,                                                 // cached_mc_enabled
 -            None,                                                  // effort_value
 -            &(),                                                   // extra_body
 -            &(),  ...

GitHub Actions: CI / Format: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run cargo fmt --all -- --check
 �[36;1mcargo fmt --all -- --check�[0m
 shell: /usr/bin/bash -e {0}
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   CARGO_HOME: /home/runner/.cargo
   CARGO_INCREMENTAL: 0
 ##[endgroup]
 Diff in /home/runner/work/Jcode/Jcode/benches/startup.rs:15:
  //! cargo bench --bench startup -- --save-baseline before
  //! ```
 -use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
 +use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
  use std::sync::atomic::{AtomicUsize, Ordering};
  // ---------------------------------------------------------------------------
 Diff in /home/runner/work/Jcode/Jcode/crates/jcode-app-core/src/agent/cache_vectors.rs:37:
          fast_mode: bool,
      ) {
          let snapshot = snapshot_current_state(
 -            &system_prompt,                                        // system_prompt
 -            &tools.iter().map(|t| t.input_schema.clone()).collect::<Vec<_>>(), // tool_schemas
 -            &(),                                                   // cache_control
 -            per_tool_hashes(tools),                                // per_tool_hashes
 -            model.to_string(),                                     // model
 -            fast_mode,                                             // fast_mode
 -            String::new(),                                         // global_cache_strategy
 -            Vec::new(),                                            // betas
 -            false,                                                 // auto_mode_active
 -            false,                                                 // is_using_overage
 -            false,                                                 // cached_mc_enabled
 -            None,                                                  // effort_value
 -            &(),                                                   // extra_body
 -            &(),  ...

GitHub Actions: CI / 1_Windows Cross-Target Check (Linux).txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / Windows Cross-Target Check (Linux): [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / 3_Quality Guardrails.txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / Quality Guardrails: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / 6_Build & Test (ubuntu-latest).txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   RUSTUP_TOOLCHAIN: stable
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / Build & Test (ubuntu-latest): [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   RUSTUP_TOOLCHAIN: stable
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / 7_Build & Test (windows-latest).txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / Build & Test (windows-latest): [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / 9_Build & Test (macos-latest).txt: [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   RUSTUP_TOOLCHAIN: stable
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.

GitHub Actions: CI / Build & Test (macos-latest): [Instinct] Fix OpenRouter EOF panic and duplicate CI env mappings

Conclusion: failure

View job details

##[group]Run webfactory/[email protected]
 with:
   log-public-key: true
 env:
   JCODE_CI: 1
   CARGO_TERM_COLOR: always
   SCCACHE_GHA_ENABLED: true
   RUSTUP_TOOLCHAIN: stable
 ##[endgroup]
 ##[error]The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.
🧰 Additional context used
🪛 zizmor (1.30.1)
.github/workflows/ios-testflight.yml

[warning] 1-148: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

.github/workflows/windows-smoke.yml

[warning] 1-204: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

.github/workflows/ci.yml

[warning] 1-680: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🔇 Additional comments (5)
.github/workflows/ci.yml (1)

14-14: LGTM!

.github/workflows/ios-testflight.yml (1)

16-16: LGTM!

.github/workflows/windows-smoke.yml (1)

21-21: LGTM!

crates/jcode-provider-openrouter/src/stream.rs (1)

3-3: LGTM!

Also applies to: 72-73, 935-938

crates/jcode-provider-openrouter/src/stream_eof_tests.rs (1)

3-34: LGTM!

📝 Summary

Summary

Fuses the OpenRouter stream so buffered final events can drain after transport EOF and later polls remain terminal. Adds tests for empty and nonempty streams.

Also merges duplicate workflow-level environment mappings in CI, Windows Smoke, and iOS TestFlight. The JCODE_CI setting retains its workflow-wide scope.

Validation

The supplied PR context reports that all 32 jcode-provider-openrouter tests pass, actionlint passes for all three workflows, and git diff --check passes.

Walkthrough

Three GitHub Actions workflows move JCODE_CI into their shared environment blocks. OpenRouterStream::new now stores a fused upstream stream, and tests cover EOF behavior for empty and single-event inputs.

Changes

Workflow Environment

Layer / File(s) Summary
Shared workflow environment
.github/workflows/ci.yml, .github/workflows/ios-testflight.yml, .github/workflows/windows-smoke.yml
Each workflow declares JCODE_CI: "1" in its existing shared environment block.

OpenRouter Stream EOF

Layer / File(s) Summary
Fused stream and EOF coverage
crates/jcode-provider-openrouter/src/stream.rs, crates/jcode-provider-openrouter/src/stream_eof_tests.rs
OpenRouterStream::new stores a fused upstream stream. Tests for empty input and a single content event assert one MessageEnd, followed by None on three reads.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: 1jehuang

Merge Risk: ⚪ Minimal · up to a1159

No merge-blocking issue is identified; the PR is mergeable after normal checks.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly summarizes both primary changes: the OpenRouter EOF panic fix and the duplicate CI environment mapping cleanup.
Description check Passed The description directly explains the OpenRouter stream fix, workflow environment changes, tests, validation results, and related issue.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Oct 12, 2026
@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. hello is never asserted, so this test still passes if EOF handling drops the final TextDelta while emitting MessageEnd.

Possible bug · crates/jcode-provider-openrouter/src/stream_eof_tests.rs:23-29

@codeant-ai

codeant-ai Bot commented Oct 12, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; the stream change and workflow environment relocation show no concrete regression.
  • Fusing the OpenRouter stream keeps EOF terminal while final events are drained, with tests checking repeated reads after completion.

Assessed commit: a115961e68d5

@KooshaPari
KooshaPari merged commit 52652dc into master Oct 12, 2026
11 of 19 checks passed
@kilo-code-bot

kilo-code-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

What this PR does

Fuses the OpenRouter SSE transport inside OpenRouterStream::new (inner: Box::pin(stream.fuse())) so that polling the underlying stream after transport EOF returns a terminal None instead of re-polling a completed/EOF stream (the EOF panic). It also consolidates duplicate workflow-level env: keys in the CI, Windows Smoke, and iOS TestFlight workflows (merging JCODE_CI: "1" into the existing env: block), which actionlint validates.

Verification notes (static; read-only sandbox, no cargo/gh execution)

  • stream.rs L3 now imports StreamExt, which is genuinely used by stream.fuse(); Stream remains used (field type + impl Stream). No unused-import warning.
  • stream.fuse() yields Fuse<S>; Fuse<S>: Stream<Item = S::Item> and Fuse<S>: Send when S: Send + 'static (both hold for the impl Stream<...> + Send + 'static bound on new), so it coerces to the Pin<Box<dyn Stream<Item = Result<Bytes, reqwest::Error>> + Send>> field. The first Ready(None) is identical to the unfused stream; only re-polls after EOF differ (terminal None), so the existing buffer-flush + single-MessageEnd path in poll_next (unchanged lines) is unaffected.
  • The fix applies uniformly to all callers (openrouter_sse_stream.rs:332, plus tests) since it lives inside new.
  • CI: the original workflows had two top-level env: blocks (one with only JCODE_CI, one with the sccache/cargo vars); merging keeps JCODE_CI at workflow scope (still applied to all jobs). No behavior change beyond removing the duplicate key.
  • New stream_eof_tests.rs: futures::stream::unfold closure is by-value (FnMut(T) — Unfold<T,F,Fut> has no lifetime, so Fut is 'static), so capturing the owned IntoIter and returning the advanced iterator is type-correct. The async block has no .await (so its future is Unpin), satisfying the Fut: Unpin bound. Logic verified for both the empty and 1-chunk cases: exactly one MessageEnd, then None for 3 extra polls.

Must Fix

None.

Should Fix

None.

Consider

  • stream_eof_tests.rs asserts a single MessageEnd after EOF but does not assert the buffered content ("hello") is delivered. Adding a content assertion would strengthen coverage of the end-of-stream drain path (minor; the test already guards the no-re-panic terminal contract).
  • stream.rs is ~938 lines, exceeding the 500-line guideline in AGENTS.md. This is pre-existing and outside this PR's scope; consider decomposing in a follow-up.

Approve / Request Changes

Approve. No violations of the repo constraints in the changed lines. OpenRouterStream::new signature is unchanged (backwards compatible), no new dependencies, and the test compiles and verifies the regression.

Files Reviewed (5 files)

  • .github/workflows/ci.yml
  • .github/workflows/ios-testflight.yml
  • .github/workflows/windows-smoke.yml
  • crates/jcode-provider-openrouter/src/stream.rs
  • crates/jcode-provider-openrouter/src/stream_eof_tests.rs

Reviewed by free · Input: 345.7K · Output: 75.5K · Cached: 530.5K

@KooshaPari
KooshaPari deleted the instinct/ci-workflow-env branch November 26, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Instinct] OpenRouter EOF panic and invalid CI workflows

2 participants