Skip to content

refactor: consolidate session-tree + session-inbox into single session worker - #111

Merged
ytallo merged 5 commits into
mainfrom
feat/consolidate-session-workers
May 13, 2026
Merged

refactor: consolidate session-tree + session-inbox into single session worker#111
ytallo merged 5 commits into
mainfrom
feat/consolidate-session-workers

Conversation

@ytallo

@ytallo ytallo commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Merge session-tree and session-inbox into a single session worker (binary iii-session). Both surfaces register from one process and share engine connection, runtime, and release cadence.
  • Wire-level function ids (session-tree::*, session-inbox::*) are unchanged — no caller migration needed in harness/web, turn-orchestrator, or provider-router.
  • Library exposes session::tree and session::inbox modules; harness-types subcrate moves with it. SessionConfig merges the three knobs (store_backend, engine_url, state_scope).
  • Dependents (harness, turn-orchestrator, provider-router) declare a single session: "^0.1.0" dep instead of the two old workers. Release pipeline, registry index, and create-tag worker list collapse to one entry.

Test plan

  • cargo build in session/ — clean
  • cargo test in session/ — 76 passed, 1 ignored (gated restart_e2e)
  • cargo build --tests in turn-orchestrator/, provider-router/, harness/ — clean
  • iii-session --manifest emits valid JSON with all three default-config keys
  • CI: release workflow tag pattern (session/v*) and create-tag choice list resolve
  • Smoke-run harness with new session dep against a live engine

Summary by CodeRabbit

  • New Features

    • Unified session worker consolidates session storage (session-tree::*) and per-session inbox (session-inbox::*) functionality into a single deployable package, eliminating the need for separate worker configurations.
  • Chores

    • Updated all dependent workers and configurations to reference the new consolidated session worker.
    • Enhanced documentation with clearer formatting and guidance.

Review Change Stack

…n worker

Both surfaces (`session-tree::*` and `session-inbox::*`) now register from one
binary (`iii-session`). They share the same engine connection, runtime, and
release cadence. Wire-level function ids are unchanged, so callers in
harness/web, turn-orchestrator, and provider-router don't need to migrate.

Library exposes `session::tree` and `session::inbox` modules; the `session`
worker carries the `harness-types` subcrate previously inside session-tree.
Configuration merges into one `SessionConfig` (store_backend + engine_url +
state_scope).

Workers that depended on the two old workers now declare a single `session`
dep (harness, turn-orchestrator, provider-router). Release pipeline, registry,
and create-tag workflow updated to the unified worker name.
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR consolidates two separate session worker packages (session-inbox and session-tree) into a unified session worker exposing both function namespaces (session-tree::* and session-inbox::*) from a single binary, with unified configuration, updated dependencies across the codebase, and comprehensive documentation.

Changes

Session Worker Consolidation

Layer / File(s) Summary
Configuration Model and Loading
session/src/config.rs
New SessionConfig struct with serde defaults for store_backend, engine_url, and state_scope; includes load_config() helper and tests validating YAML overrides and defaults consistency.
Package Identity and Deployment Metadata
session/Cargo.toml, session/iii.worker.yaml
Crate renamed from session-tree to session with updated version and target names; iii.worker.yaml defines unified binary deployment registering both session-tree::* and session-inbox::* function namespaces.
Library Root and Module Organization
session/src/lib.rs, session/src/inbox/mod.rs, session/src/inbox/handler.rs
Exports unified config, inbox, tree, and manifest submodules; inbox module removes manifest export; handler imports updated to use relative super:: paths for constants and config.
Manifest Generation from Configuration
session/src/manifest.rs
Module manifest now generated using SessionConfig::default() serialized to JSON; tests extended to validate all three config fields as strings.
Main Entrypoint and Surface Registration
session/src/main.rs
CLI accepts optional --url flag, loads SessionConfig with defaults, selects tree storage backend (memory/iii_state), registers tree::* surface then inbox::* surface with iii, and manages skill registration/unregistration lifecycle.
Tree Storage and Import Path Updates
session/src/tree/mod.rs, session/src/tree/store_iii_state.rs
Skill documentation paths updated from ../ to ../../; store imports updated from crate:: to crate::tree::.
Test Helpers and Integration Tests
session/tests/common/mod.rs, session/tests/manifest.rs, session/tests/inbox_integration.rs, session/tests/tree_*.rs
session_executable() helper resolves unified session test binary; integration tests updated to use session::tree and session::inbox namespaces; manifest test validates all three config fields as strings; tree and inbox tests import and reference unified module paths.
Dependent Workers, CI Workflows, and Registry
harness/iii.worker.yaml, provider-router/iii.worker.yaml, turn-orchestrator/iii.worker.yaml, turn-orchestrator/tests/common/mod.rs, .github/workflows/create-tag.yml, .github/workflows/release.yml, registry/index.json
Dependencies updated from split workers to unified session; GitHub Actions workflows updated to trigger on unified session/v* tags; registry replaces two worker entries with single session entry including default configuration; turn-orchestrator test harness updated to locate and boot iii-session binary with tree_integration_memory.yaml config.
Build Infrastructure, Scripts, and Documentation
harness/Makefile, harness/scripts/demo.sh, harness/scripts/real-usage.sh, README.md, provider-router/README.md, turn-orchestrator/README.md, harness/ARCHITECTURE.md, session/README.md, session/docs/, session/skills/, session/skill.md
WORKERS list updated to unified session; real-usage.sh documentation clarified to distinguish store behaviors; project READMEs updated to reference unified session; session/README.md documents consolidated worker with config options; comprehensive session-tree::* API documentation with parent-id DAG storage model, session operations, and guidance for agent resumption; punctuation normalization (em dashes to semicolons) throughout documentation.
Legacy Package Removal
session-inbox/, session-tree/
Complete deletion of session-inbox and session-tree directories including Cargo.toml manifests, README documentation, iii.worker.yaml configurations, main.rs entrypoints, config.rs modules, and manifest builders.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes


Possibly related PRs

  • iii-hq/workers#110: Updates GitHub Actions release/tag machinery around session workers—create-tag.yml's workflow_dispatch.inputs.worker options and release.yml tag-trigger patterns shift away from session-inbox/session-tree toward session.
  • iii-hq/workers#102: Both PRs modify harness/scripts/demo.sh's WORKERS list, with the main PR swapping session-tree/session-inbox for session while the related PR adds other workers.
  • iii-hq/workers#118: Main PR deletes/replaces session-inbox/session-tree worker entrypoints and their iii.worker.yaml configs, which directly overlaps with that PR's renaming of those same workers' binary names.

Suggested reviewers

  • andersonleal
  • sergiofilhowz

🐰 Two workers merged into one,
Configuration unified, the deed is done!
Session-tree and inbox now dance as one,
Under the session star, bright and fun!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: consolidating two separate workers (session-tree and session-inbox) into a single session worker.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/consolidate-session-workers

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

6 verified, 19 skipped (no docs/).

72 errors across the verified workers.

File Line Severity Violation
auth-credentials/README.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/README.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skill.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skill.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/delete_token.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/get_token.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/list_providers.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/set_token.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/status.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/status.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
auth-credentials/skills/status.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/README.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/README.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skill.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skill.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/alert_set.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/check.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/check.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/create.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/delete.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/exempt.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/forecast.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/forecast.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/get.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/list.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/pause.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/record.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
llm-budget/skills/usage.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/README.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/README.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/skill.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/skill.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/skills/get.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/skills/register.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
models-catalog/skills/supports.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/README.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/README.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/README.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/README.md 19 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skill.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skill.md 5 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skill.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skill.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/chmod.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/exec.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/exec.md 18 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/exec_bg.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/exec_bg.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/grep.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/kill.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/list.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/ls.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/ls.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/mkdir.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/mv.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/mv.md 16 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/read.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/read.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/read.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/rm.md 14 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/sed.md 16 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/sed.md 18 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/stat.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
shell/skills/status.md 13 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/README.md 8 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/README.md 19 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skill.md 7 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skill.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skills/start.md 9 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skills/start.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skills/start.md 17 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)
turn-orchestrator/skills/start_and_wait.md 15 error [Terminology.EmDash] Avoid em dashes ('—'). Rewrite with commas, parentheses, periods, or colons. (error)

ytallo added 3 commits May 13, 2026 06:39
Aligns with the bin==name policy from #118 — `iii worker add` extracts
the binary by worker name, so the published archive must contain a
binary named `session`, not `iii-session`.
skill-check Terminology.EmDash flags every '—' in session/README.md,
session/skill.md, and session/skills/*.md. Updates the hand-written
README plus the docs/ sources, then mirrors the substitutions into the
rendered files so the next render is a no-op.
`cargo fmt --check` flagged `session/src/tree/mod.rs` tuple wrapping and
`turn-orchestrator/tests/common/mod.rs` chained `.join(...)` calls.
Applied rustfmt; no functional change.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
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 `@session/tests/common/mod.rs`:
- Around line 7-10: The current binary lookup in session/tests/common/mod.rs
only checks candidate = dir.join("target").join(profile).join("session") (where
dir = Path::new(env!("CARGO_MANIFEST_DIR"))), which fails for workspace builds;
update the probe to also check the workspace-level target directory (e.g., find
the workspace root from dir or its ancestors and also test
workspace_root.join("target").join(profile).join("session")) and use the first
existing path before panic so both per-crate and workspace targets are
supported.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e0c757c5-f12c-4555-b1c9-92d7e361e802

📥 Commits

Reviewing files that changed from the base of the PR and between f62f6bc and ee8e1d2.

⛔ Files ignored due to path filters (1)
  • session/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • .github/workflows/create-tag.yml
  • .github/workflows/release.yml
  • harness/iii.worker.yaml
  • provider-router/iii.worker.yaml
  • session/Cargo.toml
  • session/README.md
  • session/config.yaml
  • session/docs/companions.md
  • session/docs/intro.md
  • session/docs/leaves/append.md
  • session/docs/leaves/clone.md
  • session/docs/leaves/compact.md
  • session/docs/leaves/create.md
  • session/docs/leaves/export_html.md
  • session/docs/leaves/fork.md
  • session/docs/leaves/messages.md
  • session/docs/leaves/tree.md
  • session/docs/quickstart.md
  • session/iii.worker.yaml
  • session/skill.md
  • session/skills/append.md
  • session/skills/clone.md
  • session/skills/compact.md
  • session/skills/create.md
  • session/skills/export_html.md
  • session/skills/fork.md
  • session/skills/messages.md
  • session/skills/tree.md
  • session/src/main.rs
  • session/src/tree/mod.rs
  • session/tests/common/mod.rs
  • session/tests/manifest.rs
  • session/tests/tree_integration.rs
  • session/tests/tree_restart_e2e.rs
  • session/tests/tree_skill.rs
✅ Files skipped from review due to trivial changes (18)
  • session/skills/clone.md
  • session/skills/create.md
  • session/skills/append.md
  • session/skill.md
  • session/README.md
  • session/skills/export_html.md
  • session/docs/leaves/append.md
  • session/docs/leaves/export_html.md
  • session/docs/leaves/clone.md
  • session/docs/leaves/create.md
  • session/skills/messages.md
  • provider-router/iii.worker.yaml
  • session/docs/leaves/messages.md
  • session/skills/compact.md
  • session/docs/intro.md
  • .github/workflows/release.yml
  • session/docs/leaves/compact.md
  • session/src/tree/mod.rs
🚧 Files skipped from review as they are similar to previous changes (9)
  • session/tests/manifest.rs
  • harness/iii.worker.yaml
  • .github/workflows/create-tag.yml
  • session/iii.worker.yaml
  • session/tests/tree_integration.rs
  • session/Cargo.toml
  • session/tests/tree_skill.rs
  • session/tests/tree_restart_e2e.rs
  • session/src/main.rs

Comment on lines 7 to 10
let dir = Path::new(env!("CARGO_MANIFEST_DIR"));
for profile in ["debug", "release"] {
let candidate = dir.join("target").join(profile).join("session-inbox");
let candidate = dir.join("target").join(profile).join("session");
if candidate.is_file() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Harden fallback binary lookup for workspace targets (Line 7).

The fallback only probes <crate>/target/..., which can fail in workspace setups where artifacts are under <workspace>/target/.... Consider checking both locations before panicking.

Suggested patch
-    let dir = Path::new(env!("CARGO_MANIFEST_DIR"));
-    for profile in ["debug", "release"] {
-        let candidate = dir.join("target").join(profile).join("session");
-        if candidate.is_file() {
-            return candidate;
-        }
-    }
+    let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
+    let target_roots = [
+        manifest_dir.join("target"),
+        manifest_dir.parent().unwrap_or(manifest_dir).join("target"),
+    ];
+    for target_root in target_roots {
+        for profile in ["debug", "release"] {
+            let candidate = target_root.join(profile).join("session");
+            if candidate.is_file() {
+                return candidate;
+            }
+        }
+    }

Also applies to: 15-15

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@session/tests/common/mod.rs` around lines 7 - 10, The current binary lookup
in session/tests/common/mod.rs only checks candidate =
dir.join("target").join(profile).join("session") (where dir =
Path::new(env!("CARGO_MANIFEST_DIR"))), which fails for workspace builds; update
the probe to also check the workspace-level target directory (e.g., find the
workspace root from dir or its ancestors and also test
workspace_root.join("target").join(profile).join("session")) and use the first
existing path before panic so both per-crate and workspace targets are
supported.

@ytallo
ytallo merged commit 05cb114 into main May 13, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants