Repository navigation
Conversation
Recent Rex builds export only REX_BLOCK in terminals. Instead of failing with 'not in Rex', inspect the block to find its session, mirroring the CLI's own session resolution rules. Adds fallback success/failure tests.
Owner
|
Closing in favor of #39. Thanks for the report. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the fallback suggested in #41.
Problem
Recent Rex builds export only
REX_BLOCK(plusREX_BIN_DIR) in terminal environments;REX_SESSIONis empty.New()then returnsnil, false, sosshows "not in Rex, press y to copy" and agent state watching (Last Turn) cannot work either.Fix
When
REX_SESSIONis empty butREX_BLOCKis set, resolve the session withrex block inspect "$REX_BLOCK" --json→.session_id(3s timeout). This mirrors the CLI's own documented session resolution: use the session containingREX_BLOCKwhen available, otherwiseREX_SESSION, otherwise the only session.No behavior change when
REX_SESSIONis set.Tests
TestNewBlockSessionFallback: onlyREX_BLOCKset → client resolves the session and uses it forsession.list_blocksTestNewBlockSessionFallbackFailure: unresolvable block →nil, falsego test ./...)Live verification
Built locally on macOS arm64 against Rex app 0.1.0-preview.38 / server 0.1.0-preview.25: comments now send successfully ("sent 1 comment to shell") with the stock generated
rexdiff_toggle.lua, no local patches needed.Closes #41