GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(collaboration): scope catalog-state guidance to what we can attribute by abhisheksharma2411 · Pull Request #1407 · lidge-jun/opencodex Conversation
|
|
✅ Deterministic PR hygiene checks passed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughV2 collaboration guidance now suppresses catalog-derived guidance for ChangesCatalog Guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CatalogStateCollector
participant CollaborationGuidance
participant Caller
CatalogStateCollector->>CollaborationGuidance: Provide catalog state
alt stale or unknown
CollaborationGuidance-->>Caller: Return no catalog-derived guidance
else fresh or not_running
CollaborationGuidance-->>Caller: Return preferred-model guidance
end
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6b496df to
96132bc
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The wording split is directionally useful, but the current head still preserves the underlying request-scoping bug confirmed in #1395, so I am requesting changes.
collectCodexAppServerCatalogState() folds every current-user app-server into one global state, and the inbound request carries no sender PID or catalog fingerprint. A known-stale process A can therefore make a fresh process B receive this PR's do not set model or reasoning_effort instruction. Rewording only unknown does not fix that case, and the same identity limitation applies to both stale and unknown.
For either state, suppress OpenCodex's disk-derived preferred-model, roster, fallback, and custom guidance, but do not prohibit options advertised by the active spawn_agent tool. The minimal safe behavior is to return no OCX-authored v2 guidance for stale or unknown; keep fresh and not_running unchanged.
Please update the regression so a mixed stale/fresh process set can still produce the global stale observation without producing a blanket no-override instruction for an unidentified request. Also update the catalog/subagent behavior documentation, because this changes the user-visible guidance contract. Once that is done on current dev and exact-head CI is green, this can cover both #1354 and #1395 without a duplicate PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
96132bc to
2e5f4f4
Compare
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes. The wording split is useful, but the current head is not merge-ready.
collectCodexAppServerCatalogState() folds every detected current-user app-server into one global state. A stale process A therefore makes the global result stale, even if the current request came from a fresh process B. multiAgentGuidanceText() has no sender PID/catalog identity, yet this PR still injects do not set model or reasoning_effort overrides for that global state.
That preserves the confirmed #1395 request-scoping bug. For stale and unknown, suppress OpenCodex-authored disk/catalog guidance, but do not prohibit model/reasoning options exposed by the active spawn_agent tool. The minimal safe behavior is to emit no OCX-authored v2 model guidance for those states, or otherwise make the active tool schema authoritative.
The added test explicitly requires both stale and unknown to contain do not set, so it codifies the #1395 bug instead of protecting the intended boundary.
Please add a mixed stale/fresh regression: one process starts before the catalog, another after it, collector resolves globally to stale, and an unidentified current v2 request must not receive a blanket no-override instruction.
The new unknown message says (app-server start time or catalog timestamp unreadable), but unknown can also result from process-enumeration failure. That still asserts a cause which is not established. If any unknown guidance remains, keep it cause-neutral, e.g. Could not verify whether Codex's model catalog is current.
Because #1407 is now the selected overlapping fix path for #1354 and #1395, update the catalog/subagent guidance documentation to describe the actual stale/unknown contract.
The reviewed head is also behind current dev, and exact-head React Doctor / Cross-platform CI have not executed jobs yet (action_required, zero jobs). Rebase or merge current dev and get exact-head CI green before merge.
I found no new exploitable security vulnerability in this diff. The blocking issues are correctness, request scoping, and regression coverage.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2e5f4f4 to
0ec70c5
Compare
…bute
`collectCodexAppServerCatalogState()` folds every app-server owned by the
current user into ONE global observation, and an inbound request carries no
sender PID or catalog fingerprint. So a stale process A makes the global state
`stale` even when the request came from a fresh process B, and `unknown` can be
reached by a process-enumeration failure that says nothing about any particular
server.
v2 guidance nonetheless injected
do not set model or reasoning_effort overrides until Codex restarts
off that global observation. Two problems follow:
* it prohibits options the active `spawn_agent` tool legitimately advertises,
for a request that cannot be attributed to the stale process (lidge-jun#1395); and
* the same text was emitted for `unknown`, asserting a cause that was never
established and a restart that cannot clear a failed measurement (lidge-jun#1354).
For `stale` and `unknown`, withhold opencodex's own disk-derived claims —
preferred model, roster, fallback, custom guidance — and say nothing about
overrides, leaving the active tool schema authoritative. `fresh` and
`not_running` are unchanged.
The previous regression asserted that both states contain `do not set`, which
codified the scoping bug; it is replaced by coverage that a mixed stale/fresh
process set resolving globally to `stale` produces no blanket no-override
instruction for an unidentified request.
Documents the four-state guidance contract in the sub-agent surface guide,
including why `unknown` is not a synonym for `stale`.
Verified:
bun test tests/multi-agent-compat.test.ts -> 43 pass, 0 fail
bun test tests/codex-app-server-processes.test.ts -> 30 pass, 1 skip, 0 fail
bun x tsc --noEmit -> clean
Fixes lidge-jun#1354
Fixes lidge-jun#1395
0ec70c5 to
550091d
Compare
There was an error while loading. Please reload this page.
|
✅ Action performedReview finished.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks both — you're right, and the second point is the one that stings: my regression asserted What changed
Regression replaced. The new one builds a genuinely mixed process set through the collector — pid 42 starting before the catalog, pid 43 after — asserts the global observation really does resolve to On the cause-neutrality point — you were right and I'd made the same mistake I was fixing. My Docs — added a four-state table to the sub-agent surface guide covering what each state does to guidance, why a global observation can't be attributed to a request, and why restarting clears Rebased onto current Happy to keep iterating if the null-guidance shape isn't quite what you had in mind for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs-site/src/content/docs/guides/sub-agent-surface.md`:
- Line 231: Update the stale-state recovery statement in the sub-agent surface
guide to say that stale clears only when every detected current-user app-server
has started after the final catalog write; do not claim that restarting Codex
alone necessarily clears stale, while preserving the existing distinction for
unknown.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 157ed10a-e253-4a05-8b8e-1906a1f87a8c
docs-site/src/content/docs/guides/sub-agent-surface.mdsrc/server/responses/collaboration.tstests/multi-agent-compat.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Clarify the distinction between 'stale' and 'unknown' states in the documentation.
There was an error while loading. Please reload this page.
🧩 Analysis chain🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== PR diff summary ===' git diff --stat HEAD^ HEAD echo echo '=== Changed files ===' git diff --name-only HEAD^ HEAD echo echo '=== Changed hunks ===' git diff --unified=80 HEAD^ HEAD -- \ src/server/responses/collaboration.ts \ tests/multi-agent-compat.test.ts \ docs-site/src/content/docs/guides/sub-agent-surface.md echo echo '=== Implementation outline ===' ast-grep outline src/server/responses/collaboration.ts --items all --view expanded echo echo '=== Focused catalog-state references ===' rg -n -C 5 '\b(stale|unknown|catalog|reasoning_effort|spawn_agent)\b' \ src/server/responses/collaboration.ts \ tests/multi-agent-compat.test.ts \ docs-site/src/content/docs/guides/sub-agent-surface.md Length of output: 96661 🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== Current commit and candidate bases ===' git status --short --branch git log --oneline --decorate -12 echo git branch --all --contains HEAD || true echo echo '=== Available dev refs ===' git for-each-ref --format='%(refname:short) %(objectname)' 'refs/remotes/*/dev' 'refs/heads/dev' || true base_ref="" for ref in origin/dev refs/remotes/origin/dev dev; do if git rev-parse --verify --quiet "$ref" >/dev/null; then base_ref="$ref" break fi done if [ -z "$base_ref" ]; then echo 'ERROR: No dev ref is available for full PR comparison.' exit 0 fi merge_base="$(git merge-base HEAD "$base_ref")" echo echo "=== Full PR range: ${merge_base}..HEAD (base: ${base_ref}) ===" git log --oneline "${merge_base}..HEAD" echo git diff --stat "${merge_base}..HEAD" echo git diff --unified=50 "${merge_base}..HEAD" -- \ src/server/responses/collaboration.ts \ tests/multi-agent-compat.test.ts \ docs-site/src/content/docs/guides/sub-agent-surface.md echo echo '=== App-server collector outline ===' collector="$(fd -a '^app-server-processes\.ts$' src | head -n 1)" printf 'collector=%s\n' "$collector" if [ -n "$collector" ]; then ast-grep outline "$collector" --items all --view expanded echo echo '=== Catalog-state collector implementation ===' rg -n -A100 -B15 '\bcollectCodexAppServerCatalogState\s*\(' "$collector" fi Length of output: 2546 🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== Commit ancestry ===' git show -s --format='commit=%H%nparents=%P%nsubject=%s' 7779c057 550091d0 04222e36 echo echo '=== Available PR diff: 7779c057..HEAD ===' git diff --stat 7779c057..HEAD git diff --unified=60 7779c057..HEAD -- \ src/server/responses/collaboration.ts \ tests/multi-agent-compat.test.ts \ docs-site/src/content/docs/guides/sub-agent-surface.md echo echo '=== Guidance control flow, Lines 226-365 ===' nl -ba src/server/responses/collaboration.ts | sed -n '226,365p' echo echo '=== Catalog-state collector source ===' collector="$(fd -a '^app-server-processes\.ts$' src | head -n 1)" printf 'collector=%s\n' "$collector" if [ -z "$collector" ]; then echo 'ERROR: app-server-processes.ts was not found under src.' exit 0 fi ast-grep outline "$collector" --items all --view expanded rg -n -A130 -B20 '\bcollectCodexAppServerCatalogState\s*\(' "$collector" echo echo '=== Documentation state section with line numbers ===' nl -ba docs-site/src/content/docs/guides/sub-agent-surface.md | sed -n '202,235p' echo echo '=== Tests for catalog-state guidance with line numbers ===' nl -ba tests/multi-agent-compat.test.ts | sed -n '115,215p' Length of output: 27091 🏁 Script executed: #!/bin/bash set -euo pipefail echo '=== Guidance control flow ===' sed -n '226,365p' src/server/responses/collaboration.ts | cat -n echo echo '=== Catalog-state collector files ===' fd -a '^app-server-processes\.ts$' src collector="$(fd -a '^app-server-processes\.ts$' src | head -n 1)" if [ -z "$collector" ]; then echo 'ERROR: app-server-processes.ts was not found under src.' exit 0 fi echo echo "=== Collector outline: ${collector} ===" ast-grep outline "$collector" --items all --view expanded echo echo '=== Collector implementation and related state tests ===' rg -n -A150 -B30 '\bcollectCodexAppServerCatalogState\s*\(' "$collector" test_collector="$(fd -a '^codex-app-server-processes\.test\.ts$' tests | head -n 1)" if [ -n "$test_collector" ]; then echo echo "=== Collector test references: ${test_collector} ===" rg -n -A45 -B12 '\b(stale|fresh|unknown|not_running|collectCodexAppServerCatalogState)\b' "$test_collector" fi echo echo '=== multiAgentGuidanceText call sites ===' rg -n -A8 -B8 '\bmultiAgentGuidanceText\s*\(' src tests \ -g '*.ts' -g '!tests/multi-agent-compat.test.ts' echo echo '=== Documentation state section ===' sed -n '202,235p' docs-site/src/content/docs/guides/sub-agent-surface.md | cat -n Length of output: 48343
The repository sandbox did not permit test execution. The inspected test coverage and implementation are consistent with the PR objective.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approving. The head scopes catalog-state guidance to what we can attribute: stale/unknown withhold disk-derived claims without a false restart/no-override prescription for unidentified requests, with regressions for mixed stale/fresh and unknown.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @abhisheksharma2411 — this was useful because it stopped treating a failed catalog measurement ( Merging now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ark Codex stale `writeRetainedCatalogSync` wrote the catalog unconditionally, with no content comparison, so every sync moved the file's mtime even when the produced bytes were identical to what was already on disk. `collectCodexAppServerCatalogState()` compares that mtime against each running Codex's start time, so an ordinary `ocx start` — or any dashboard action that re-syncs an unchanged model set — classified every already-running Codex as holding an outdated in-memory catalog. Since lidge-jun#1407 that verdict withholds all opencodex-authored v2 model guidance, so a configured `injectionModel` and roster silently stop reaching sessions for the rest of that Codex's lifetime, even though the advertised model set never changed. A long-lived Codex App app-server outlives every proxy restart, which makes the state effectively latched: restarting the CLI does not clear it. An identical write is now skipped and reported as `catalogWritten: false`. `added` still reports the routed rows the catalog carries, because they are on disk either way, and `cacheSynced` is unaffected (`refreshCodexModelCatalog` invalidates the models cache whenever the catalog exists, independently of whether it was rewritten). The comparison is byte-exact, not a decoded-string comparison. Reading the file as UTF-8 replaces every invalid sequence with U+FFFD, so a malformed byte on disk would compare equal to a legitimately encoded replacement character in the prepared content: the skip would then preserve the corruption and report `catalogWritten: false` for a file that is not what we prepared. An unreadable or absent file still falls back to a real write. The convergence/retained-sync byte-agreement assertions asserted `catalogWritten: true` for exactly the no-op case while also asserting the bytes did not change; they now assert the no-op they describe (no policy skip, no write, bytes unchanged). Assertions covering syncs that really change content are untouched.
…ark Codex stale `writeRetainedCatalogSync` wrote the catalog unconditionally, with no content comparison, so every sync moved the file's mtime even when the produced bytes were identical to what was already on disk. `collectCodexAppServerCatalogState()` compares that mtime against each running Codex's start time, so an ordinary `ocx start` — or any dashboard action that re-syncs an unchanged model set — classified every already-running Codex as holding an outdated in-memory catalog. Since lidge-jun#1407 that verdict withholds all opencodex-authored v2 model guidance, so a configured `injectionModel` and roster silently stop reaching sessions for the rest of that Codex's lifetime, even though the advertised model set never changed. A long-lived Codex App app-server outlives every proxy restart, which makes the state effectively latched: restarting the CLI does not clear it. An identical write is now skipped and reported as `catalogWritten: false`. `added` still reports the routed rows the catalog carries, because they are on disk either way, and `cacheSynced` is unaffected (`refreshCodexModelCatalog` invalidates the models cache whenever the catalog exists, independently of whether it was rewritten). The comparison is byte-exact, not a decoded-string comparison. Reading the file as UTF-8 replaces every invalid sequence with U+FFFD, so a malformed byte on disk would compare equal to a legitimately encoded replacement character in the prepared content: the skip would then preserve the corruption and report `catalogWritten: false` for a file that is not what we prepared. An unreadable or absent file still falls back to a real write. The convergence/retained-sync byte-agreement assertions asserted `catalogWritten: true` for exactly the no-op case while also asserting the bytes did not change; they now assert the no-op they describe (no policy skip, no write, bytes unchanged). Assertions covering syncs that really change content are untouched.
…ark Codex stale `writeRetainedCatalogSync` wrote the catalog unconditionally, with no content comparison, so every sync moved the file's mtime even when the produced bytes were identical to what was already on disk. `collectCodexAppServerCatalogState()` compares that mtime against each running Codex's start time, so an ordinary `ocx start` — or any dashboard action that re-syncs an unchanged model set — classified every already-running Codex as holding an outdated in-memory catalog. Since #1407 that verdict withholds all opencodex-authored v2 model guidance, so a configured `injectionModel` and roster silently stop reaching sessions for the rest of that Codex's lifetime, even though the advertised model set never changed. A long-lived Codex App app-server outlives every proxy restart, which makes the state effectively latched: restarting the CLI does not clear it. An identical write is now skipped and reported as `catalogWritten: false`. `added` still reports the routed rows the catalog carries, because they are on disk either way, and `cacheSynced` is unaffected (`refreshCodexModelCatalog` invalidates the models cache whenever the catalog exists, independently of whether it was rewritten). The convergence/retained-sync byte-agreement assertions asserted `catalogWritten: true` for exactly this no-op case while also asserting the bytes did not change; they now assert the no-op they describe (no policy skip, no write, bytes unchanged). Assertions covering syncs that really change content are untouched.
…bute (lidge-jun#1407) * fix(collaboration): scope catalog-state guidance to what we can attribute `collectCodexAppServerCatalogState()` folds every app-server owned by the current user into ONE global observation, and an inbound request carries no sender PID or catalog fingerprint. So a stale process A makes the global state `stale` even when the request came from a fresh process B, and `unknown` can be reached by a process-enumeration failure that says nothing about any particular server. v2 guidance nonetheless injected do not set model or reasoning_effort overrides until Codex restarts off that global observation. Two problems follow: * it prohibits options the active `spawn_agent` tool legitimately advertises, for a request that cannot be attributed to the stale process (lidge-jun#1395); and * the same text was emitted for `unknown`, asserting a cause that was never established and a restart that cannot clear a failed measurement (lidge-jun#1354). For `stale` and `unknown`, withhold opencodex's own disk-derived claims — preferred model, roster, fallback, custom guidance — and say nothing about overrides, leaving the active tool schema authoritative. `fresh` and `not_running` are unchanged. The previous regression asserted that both states contain `do not set`, which codified the scoping bug; it is replaced by coverage that a mixed stale/fresh process set resolving globally to `stale` produces no blanket no-override instruction for an unidentified request. Documents the four-state guidance contract in the sub-agent surface guide, including why `unknown` is not a synonym for `stale`. Verified: bun test tests/multi-agent-compat.test.ts -> 43 pass, 0 fail bun test tests/codex-app-server-processes.test.ts -> 30 pass, 1 skip, 0 fail bun x tsc --noEmit -> clean Fixes lidge-jun#1354 Fixes lidge-jun#1395 * Update sub-agent-surface.md for clarity on states Clarify the distinction between 'stale' and 'unknown' states in the documentation. --------- Co-authored-by: Wibias <[email protected]>
…ark Codex stale `writeRetainedCatalogSync` wrote the catalog unconditionally, with no content comparison, so every sync moved the file's mtime even when the produced bytes were identical to what was already on disk. `collectCodexAppServerCatalogState()` compares that mtime against each running Codex's start time, so an ordinary `ocx start` — or any dashboard action that re-syncs an unchanged model set — classified every already-running Codex as holding an outdated in-memory catalog. Since lidge-jun#1407 that verdict withholds all opencodex-authored v2 model guidance, so a configured `injectionModel` and roster silently stop reaching sessions for the rest of that Codex's lifetime, even though the advertised model set never changed. A long-lived Codex App app-server outlives every proxy restart, which makes the state effectively latched: restarting the CLI does not clear it. An identical write is now skipped and reported as `catalogWritten: false`. `added` still reports the routed rows the catalog carries, because they are on disk either way, and `cacheSynced` is unaffected (`refreshCodexModelCatalog` invalidates the models cache whenever the catalog exists, independently of whether it was rewritten). The convergence/retained-sync byte-agreement assertions asserted `catalogWritten: true` for exactly this no-op case while also asserting the bytes did not change; they now assert the no-op they describe (no policy skip, no write, bytes unchanged). Assertions covering syncs that really change content are untouched.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.