Skip to content

fix: restore owner-scoped gateway startup - #1625

Merged
henrypark133 merged 7 commits into
stagingfrom
codex/ci-run-23502891955-fix
Mar 24, 2026
Merged

henrypark133 merged 7 commits into
stagingfrom
codex/ci-run-23502891955-fix

Conversation

@henrypark133

Copy link
Copy Markdown
Collaborator

Summary

  • fix the E2E startup harness so server boot failures report the real stderr instead of masking it with ProcessLookupError
  • keep the single-user gateway authenticated as the durable owner scope while preserving GATEWAY_USER_ID as the sender/routing identity
  • align the startup workspace with the owner scope so owner-scoped routines and gateway flows stay consistent

Validation

  • cargo fmt --all
  • cargo clippy --no-default-features --features libsql --all-targets -- -D warnings
  • cargo test --lib --no-default-features --features libsql tunnel --no-run
  • pytest scenarios/test_connection.py::test_page_loads_and_connects -v -s
  • pytest scenarios/test_owner_scope.py::test_http_channel_created_routine_is_visible_in_web_routines_tab -v -s
  • pytest scenarios/test_owner_scope.py::test_web_created_routine_is_listed_from_http_channel_across_senders -v -s

Copilot AI review requested due to automatic review settings March 24, 2026 21:38
@github-actions github-actions Bot added scope: channel/web Web gateway channel size: M 50-199 changed lines risk: medium Business logic, config, or moderate-risk modules labels Mar 24, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the application's startup process and gateway behavior by enhancing error reporting in end-to-end tests and standardizing authentication and workspace scoping. It ensures that server startup failures provide more actionable feedback and that single-user gateways consistently operate within the defined owner scope, improving overall reliability and predictability.

Highlights

  • Improved E2E Test Error Reporting: The E2E startup harness now reports the real stderr on server boot failures, preventing ProcessLookupError from masking the actual cause.
  • Owner-Scoped Gateway Authentication: Single-user gateways are now authenticated with the durable owner scope, while still preserving GATEWAY_USER_ID for sender/routing identity.
  • Consistent Workspace Alignment: The startup workspace is aligned with the owner scope, ensuring consistency for owner-scoped routines and gateway flows.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR restores “owner-scoped” behavior for gateway startup and E2E harnessing, ensuring that durable state (workspace/routines) aligns to IRONCLAW_OWNER_ID while keeping GATEWAY_USER_ID as the sender/routing identity, and improving boot failure diagnostics in E2E tests.

Changes:

  • Improve E2E startup failure handling to surface server stderr without being masked by process lookup errors.
  • Re-scope gateway single-user auth to the durable owner scope while preserving sender/routing identity.
  • Resolve the startup workspace (and memory tooling workspace) against owner_id instead of the gateway sender id.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/e2e/conftest.py Adjusts subprocess shutdown behavior on startup timeout to better capture stderr.
src/main.rs Applies owner-scope rebinding for single-user gateway at startup.
src/config/mod.rs Resolves the startup workspace config using owner_id instead of gateway user_id.
src/channels/web/server.rs Sets IncomingMessage.sender_id explicitly to preserve routing identity.
src/channels/web/mod.rs Adds GatewayChannel::with_owner_scope() to rebind single-user auth identity.
src/app.rs Uses owner_id for workspace initialization used by memory tools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/channels/web/server.rs Outdated
Comment thread src/channels/web/server.rs Outdated
Comment thread tests/e2e/conftest.py Outdated
Comment thread src/channels/web/mod.rs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors workspace and authentication logic to consistently use the owner_id for the base runtime workspace, particularly when multi-user tokens are not configured. This involves introducing a with_owner_scope method for GatewayChannel and applying it during initialization, as well as explicitly assigning a sender_id to incoming messages. Additionally, the end-to-end test fixtures have been improved for more robust process termination and error reporting. A review comment points out that the use of the unstable Rust let-chain feature in src/channels/web/mod.rs violates the project's Minimum Supported Rust Version (MSRV) compatibility goals and suggests refactoring it to a stable nested if statement.

Comment thread src/channels/web/mod.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/channels/web/server.rs Outdated
Comment thread src/channels/web/mod.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/conftest.py Outdated
Comment thread src/channels/web/server.rs
Comment thread tests/e2e/conftest.py Outdated
@github-actions github-actions Bot added size: L 200-499 changed lines and removed size: M 50-199 changed lines labels Mar 24, 2026
@henrypark133
henrypark133 requested a review from Copilot March 24, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/conftest.py Outdated
Comment thread tests/e2e/conftest.py Outdated
Copilot AI review requested due to automatic review settings March 24, 2026 22:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/conftest.py
Comment thread src/main.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@henrypark133
henrypark133 merged commit 82822d7 into staging Mar 24, 2026
18 checks passed
@henrypark133
henrypark133 deleted the codex/ci-run-23502891955-fix branch March 24, 2026 23:11
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
* fix: restore owner-scoped gateway startup

* fix: split gateway owner and sender scope

* fix: keep multi-user gateway sender identity

* test: cover gateway sender scope regression

* test: harden e2e startup teardown race

* fix: align gateway owner scope across auth modes
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
* fix: restore owner-scoped gateway startup

* fix: split gateway owner and sender scope

* fix: keep multi-user gateway sender identity

* test: cover gateway sender scope regression

* test: harden e2e startup teardown race

* fix: align gateway owner scope across auth modes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: channel/web Web gateway channel size: L 200-499 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants