Skip to content

quality: resolve open Code Quality findings #123-#139 - #171

Merged
ThePlenkov merged 4 commits into
mainfrom
fix/quality-security-main
Aug 12, 2026
Merged

quality: resolve open Code Quality findings #123-#139#171
ThePlenkov merged 4 commits into
mainfrom
fix/quality-security-main

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

Resolves the open GitHub Code Quality findings for gascity/scripts/gc-session-devin and packages/adt-tui/src/Navigator.tsx:

  • py/unused-import: remove unused shlex import.
  • py/unused-global-variable: remove _WAKEUP_W; close the previous wakeup write fd via signal.set_wakeup_fd's return value.
  • py/unused-local-variable: remove unused name in _local_worker.
  • py/mixed-returns: add explicit return 0 at the end of _devin_worker.
  • py/empty-except: document best-effort exception handlers with brief comments.
  • js/trivial-conditional: simplify if (!current || !pageResult) to if (!pageResult) after the earlier !current guard.

These changes clear the CodeQL quality alerts listed in security/quality and should also clear any overlapping AI findings under security/quality/ai-findings once the default branch is re-analyzed.

Link to Devin session: https://app.devin.ai/sessions/1d687ed76ba84d7b90d894af9a5ffbe7
Requested by: @ThePlenkov


Summary by cubic

Resolves Code Quality findings (#123-#139) and hardens worker lifecycle in gascity/scripts/gc-session-devin, plus a small guard cleanup in packages/adt-tui/src/Navigator.tsx. Improves wakeup FD handling and process cleanup for more reliable sessions.

  • Bug Fixes
    • Retire the previous wakeup FD via signal.set_wakeup_fd(-1) before creating a new self-pipe; roll back on setup failure to avoid FD aliasing and leaks.
    • Harden process lifecycle: differentiate ProcessLookupError, PermissionError, and OSError in stop/alive/interrupt paths; return errors and log; keep the child PID file if the local command can’t be terminated; add targeted waits after SIGTERM/SIGKILL.
    • Code quality cleanup: remove unused shlex and a dead local, add explicit return 0 to _devin_worker, add brief comments to intentional empty excepts, and simplify the Navigator conditional.

Written for commit a863b70. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved session signal and process cleanup handling for more reliable termination.
    • Preserved navigation state correctly when page content is unavailable.
    • Maintained the “No content loaded” fallback for missing page results.

- Remove unused import (shlex) and unused global variable (_WAKEUP_W).
- Drop dead local variable and simplify redundant conditional.
- Add explicit return 0 to _devin_worker to avoid mixed implicit/explicit returns.
- Document best-effort exception handlers that intentionally swallow errors.

Resolves GitHub Code Quality findings #123-#139.

Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
@ThePlenkov ThePlenkov self-assigned this Aug 12, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit a863b70
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6a7c518b7dc02c0008b6c083

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The session script now manages wakeup descriptors more directly, documents expected process-cleanup exceptions, removes unused locals, and returns worker success explicitly. The Navigator fallback now checks only whether page results exist.

Changes

Session cleanup updates

Layer / File(s) Summary
Wakeup descriptor management
gascity/scripts/gc-session-devin
The script removes the unused shlex import, retains only the wakeup read descriptor, closes previous descriptors, and documents signal-interruption handling.
Process cleanup and worker completion
gascity/scripts/gc-session-devin
The script documents expected process and child-PID cleanup exceptions, removes an unused worker name assignment, adds cleanup-path comments, and returns worker success explicitly.

Navigator page guard

Layer / File(s) Summary
Empty-page fallback condition
packages/adt-tui/src/Navigator.tsx
The empty-page fallback now checks only whether pageResult exists.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the quality findings resolved by the pull request and matches the changes in both modified files.
✨ 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 fix/quality-security-main

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.

@amazon-q-developer amazon-q-developer 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.

The code quality improvements in this PR correctly address the CodeQL findings. The changes remove unused imports and variables, fix the mixed-returns pattern in _devin_worker, simplify a redundant conditional check in Navigator.tsx, and add documentation comments to empty exception handlers. All fixes are appropriate and maintain correct functionality.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review August 12, 2026 10:26

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

Actionable comments posted: 2

🤖 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 `@gascity/scripts/gc-session-devin`:
- Around line 255-257: Apply one explicit process-cleanup error policy in
gascity/scripts/gc-session-devin: at lines 255-257 catch only the exited-process
case before deleting the worker PID file; at lines 287-289 treat PermissionError
as unknown/error rather than an absent child; at lines 391-393 report
interrupt-delivery failures instead of treating every OSError as success; and at
lines 683-699 preserve child tracking while surfacing unexpected termination,
wait, and unlink failures.
- Around line 35-50: Update the wakeup-descriptor setup around
signal.set_wakeup_fd: close the existing _WAKEUP_R and retire the currently
registered wakeup descriptor before calling os.pipe(). Register the new write
descriptor before assigning _WAKEUP_R, and on any setup failure close both newly
created pipe descriptors while preserving the previous state as appropriate.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e992753b-8bd3-482d-830a-8b060936b6f7

📥 Commits

Reviewing files that changed from the base of the PR and between 9880201 and f746483.

📒 Files selected for processing (2)
  • gascity/scripts/gc-session-devin
  • packages/adt-tui/src/Navigator.tsx

Comment thread gascity/scripts/gc-session-devin Outdated
Comment thread gascity/scripts/gc-session-devin Outdated
@baz-reviewer

baz-reviewer Bot commented Aug 12, 2026

Copy link
Copy Markdown

Merger

Ready to Merge

All review discussions are resolved, and the diff addresses the reported findings without a concrete remaining blocker.

Commit a863b70 · Evaluated 2026-08-12 11:03 UTC

Review this PR on Baz | Customize your next review

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR bc690d3 Aug 12, 2026 · 10:36 10:39

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Aug 12, 2026
@devin-ai-integration
devin-ai-integration Bot marked this pull request as draft August 12, 2026 10:43
@ThePlenkov
ThePlenkov marked this pull request as ready for review August 12, 2026 10:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…dback

- Retire the previous wakeup descriptor before creating a new self-pipe and
  roll back on setup failure, avoiding fd aliasing.
- Distinguish ProcessLookupError from PermissionError/OSError in worker stop,
  child process checks, interrupt, and local-command cleanup paths.
- Preserve the child pid file when the local command cannot be terminated.

Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
Comment thread gascity/scripts/gc-session-devin Fixed
Comment thread gascity/scripts/gc-session-devin Fixed
Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@ThePlenkov
ThePlenkov merged commit 6194e1d into main Aug 12, 2026
28 checks passed
@ThePlenkov
ThePlenkov deleted the fix/quality-security-main branch August 12, 2026 11:35
@gitar-bot

gitar-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

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

Labels

baz: ready to merge size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant