Skip to content

style(agent): remove unnecessary Worker re-export (fix #891)#923

Merged
zmanian merged 1 commit into
nearai:stagingfrom
G7CNF:codex/issue-891-pubuse
Mar 12, 2026
Merged

style(agent): remove unnecessary Worker re-export (fix #891)#923
zmanian merged 1 commit into
nearai:stagingfrom
G7CNF:codex/issue-891-pubuse

Conversation

@G7CNF
Copy link
Copy Markdown
Contributor

@G7CNF G7CNF commented Mar 11, 2026

Summary

Removes an unnecessary public re-export from src/agent/mod.rs to satisfy issue #891 and align with the project style guideline (no facade re-exports unless needed by downstream consumers).

  • Removed: pub use crate::worker::{Worker, WorkerDeps};

Issue

Reproduction (before)

On staging, the redundant re-export exists:

git show staging:src/agent/mod.rs | rg "pub use crate::worker::\{Worker, WorkerDeps\};"
# -> match found

And there are no in-repo consumers via the facade path:

rg "crate::agent::Worker|crate::agent::WorkerDeps" src tests
# -> no matches

Behavior (after)

The re-export is removed from src/agent/mod.rs:

rg "pub use crate::worker::\{Worker, WorkerDeps\};" src/agent/mod.rs
# -> no matches

No internal imports depended on the removed facade path.

Validation

Targeted tests:

cargo test -q agent::session::tests::test_auto_approved_tools -- --nocapture
cargo test -q agent::dispatcher::tests::test_auto_approved_tool_is_respected -- --nocapture

Build sanity:

cargo check -q

All passed locally.

Scope

Minimal, single-line deletion in one file; no behavioral/runtime logic changes.

@github-actions github-actions Bot added scope: agent Agent core (agent loop, router, scheduler) size: XS < 10 changed lines (excluding docs) risk: medium Business logic, config, or moderate-risk modules labels Mar 11, 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 focuses on improving code hygiene by removing a redundant public re-export in the src/agent/mod.rs file. The change aligns the codebase with established style guidelines, ensuring that only necessary items are publicly exposed, without impacting any existing functionality or downstream consumers.

Highlights

Changelog
  • src/agent/mod.rs
    • Removed the pub use crate::worker::{Worker, WorkerDeps}; statement.
Activity
  • No human activity has been recorded on this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@github-actions github-actions Bot added the contributor: new First-time contributor label Mar 11, 2026
Copy link
Copy Markdown
Contributor

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

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 removes an unnecessary public re-export of Worker and WorkerDeps from the agent module. This is a good cleanup that reduces the module's public API surface. As confirmed in the pull request description, this change does not affect any internal consumers. The change is correct and improves maintainability. I have no further comments.

@G7CNF G7CNF force-pushed the codex/issue-891-pubuse branch from a48e481 to 78766e9 Compare March 11, 2026 07:30
Copy link
Copy Markdown
Collaborator

@zmanian zmanian left a comment

Choose a reason for hiding this comment

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

LGTM. Trivial one-line removal of pub use crate::worker::{Worker, WorkerDeps} from agent/mod.rs.

Confirmed no callers import Worker or WorkerDeps through crate::agent:: -- all usages go through crate::worker:: directly. No downstream breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: new First-time contributor risk: medium Business logic, config, or moderate-risk modules scope: agent Agent core (agent loop, router, scheduler) size: XS < 10 changed lines (excluding docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LOW] Unnecessary pub use re-export violates code style guideline

2 participants