Skip to content

fix(tui): only run project check when at root menu - #2470

Merged
nborges-aws merged 3 commits into
refactorfrom
project-check-fix
Sep 30, 2026
Merged

nborges-aws merged 3 commits into
refactorfrom
project-check-fix

Conversation

@nborges-aws

@nborges-aws nborges-aws commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Limit project detection to only run when TUI is at root menu.

  • Update src/tui/index.tsx to check if the route is /agentcore. Any nested routes will skip project resolution
  • Add inProject boolean to ``src/handlers/screen.tsx`. If value is undefined, screen will detect project before rendering. Boolean value passed in allows screen to render immediately
  • Update src/handlers/project/ProjectGate.tsx with react query to tell us if project exists (distinct from useProject, since we just need to know if it exists -- we don't need to load complete project)
  • Update src/components/Root.tsx to distinguish between “not in a project” and “not verified yet”. Uses existing project context when available and otherwise lets the root screen perform the check lazily

Added test coverage confirming unrelated TUI commands don't resolve the project, and that project detection runs when navigating back to root menu from any nested screen

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran bun test
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@github-actions github-actions Bot added the size/m PR size: M label Sep 30, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 30, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026

@agentcore-devx-automation agentcore-devx-automation 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.

AgentCore Harness Review

Verdict: Looks good

Small, focused fix. The isRootMenuPath check correctly avoids running projectManager.resolve when the TUI is deep-linked into a nested screen (e.g. agentcore runtime), and the new useProjectDetected gate + LoadingFrame (with optional onBack) resolves the project on-demand only once the user navigates to the root menu. Hook order is stable, the seed via ProjectDetectedKey still short-circuits the fetch when the launch already resolved it, and both the router-level and TUI-level tests cover the new behavior.

One minor thing worth being aware of (not blocking): with the old code, renderScreen("/agentcore") in tests saw inProject = false immediately (since ProjectDetectedKey isn't seeded in renderScreen); with the new code it now goes through a useProjectDetected fetch that calls FsProjectManager.resolve from the test process cwd on every root-menu test that doesn't use inProjectContext. That works today because the repo isn't itself an agentcore project, but it does couple those tests to the filesystem — worth watching if flakes appear.

Nothing here requires changes before merging.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 30, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 30, 2026
@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.29%. Comparing base (3b8330f) to head (39a08c4).
⚠️ Report is 1 commits behind head on refactor.

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2470   +/-   ##
=========================================
  Coverage     97.29%   97.29%           
=========================================
  Files           625      625           
  Lines         44799    44829   +30     
=========================================
+ Hits          43587    43617   +30     
  Misses         1212     1212           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 30, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 30, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 30, 2026
@nborges-aws
nborges-aws merged commit e7db1d5 into refactor Sep 30, 2026
19 checks passed
@nborges-aws
nborges-aws deleted the project-check-fix branch September 30, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants