Skip to content

fix(agent-detector): restore process-tree feature dropped by hakari workspace-hack - #410

Merged
getappz merged 2 commits into
masterfrom
task/428
Aug 9, 2026
Merged

fix(agent-detector): restore process-tree feature dropped by hakari workspace-hack#410
getappz merged 2 commits into
masterfrom
task/428

Conversation

@getappz

@getappz getappz commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • cargo-hakari workspace-hack (ci: run tests with nextest, add cargo-hakari workspace-hack #399, 2026-08-07) changed agent-detector = "0.2.1" to agent-detector = { version = "0.2.1", default-features = false } in both Cargo.toml and crates/flare-git-core/Cargo.toml, as an incidental side effect of feature unification — nobody explicitly re-added features = ["process-tree"].
  • process-tree gates tier 1 of the crate's 3-tier identity detection (parent process-tree walk), checked before tier 2 (generic AI_AGENT/AGENT env vars). With it silently off, every session falls straight to the fragile generic-env-var tier.
  • Concretely broke opencode's item::claim() on a handed-off item: its job runner sets AGENT=1, which misresolved its identity to "1" instead of "opencode", tripping the assignee-freeze check (crates/agentflare-backend/src/item.rs:672-684, PR feat(handoff): verified continuation commit, structured payload, duplicate-item reuse, assignee freeze #365).
  • Fix: explicitly restore features = ["process-tree"] in both locations now that hakari makes default-features non-implicit. Workspace-wide fix — restores the strongest identity signal for every session, not opencode-specific.

Filed as agentflare item #428.

Test plan

  • cargo build --workspace --all-features — clean
  • cargo fmt --all -- --check — clean
  • cargo test --workspace — 1133 passed, 1 failed (dashboard::server::tests::events_endpoint_streams_claims_and_cost_snapshot — pre-existing, unrelated, already tracked as item feat: i am just testing the workflo #409; confirmed deterministic on this machine regardless of this change)
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic — 2 pre-existing errors in crates/agentflare-jobs/src/supervisor.rs (unused import, dead code), confirmed present on unmodified master too — unrelated to this change

Summary by CodeRabbit

  • Chores
    • Improved platform-specific build support across Apple and Windows environments.
    • Enhanced process-tree detection capabilities for supported workflows.
    • No changes to exported interfaces or general user-facing behavior.

…orkspace-hack

cargo-hakari's workspace-hack (#399) changed agent-detector to
default-features=false without re-adding process-tree explicitly,
silently disabling tier-1 (parent process-tree walk) identity
detection for every session. Every session now falls straight to
tier-2 (generic AI_AGENT/AGENT env vars), which is fragile — any
harness/job-runner setting a bare AGENT=<slot-index> collides with it.

Concretely broke opencode's item claim: its job runner sets AGENT=1,
which misresolved its identity to \1\ instead of \opencode\,
tripping item::claim()'s assignee-freeze check.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8206a116-eb80-43ee-a19b-ae5891e168b9

📥 Commits

Reviewing files that changed from the base of the PR and between 3512bf4 and c3e1e34.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • agentflare-workspace-hack/Cargo.toml

📝 Walkthrough

Walkthrough

The pull request enables the process-tree feature for agent-detector and adds target-specific workspace dependencies for Apple and Windows platforms.

Changes

agent-detector feature and platform dependency configuration

Layer / File(s) Summary
Enable process-tree feature
Cargo.toml, crates/flare-git-core/Cargo.toml
Both dependency declarations enable the process-tree feature and retain disabled default features.
Add platform workspace dependencies
agentflare-workspace-hack/Cargo.toml
The workspace hack adds objc2-core-foundation for x86_64 and aarch64 Apple targets and windows API features for Windows MSVC.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the restoration of the dropped process-tree feature for agent-detector.
Description check ✅ Passed The description explains the change, impact, rationale, and test results, but omits the optional Notes for reviewers section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/428

Comment @coderabbitai help to get the list of available commands.

cargo hakari generate to add objc2-core-foundation and windows crate
entries picked up by re-enabling agent-detector's process-tree feature.
@getappz
getappz merged commit 7ad8865 into master Aug 9, 2026
18 checks passed
@getappz
getappz deleted the task/428 branch August 9, 2026 06:13
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.

1 participant