Skip to content

Testing#519

Open
h0tak88r wants to merge 3 commits into
usestrix:mainfrom
h0tak88r:testing
Open

Testing#519
h0tak88r wants to merge 3 commits into
usestrix:mainfrom
h0tak88r:testing

Conversation

@h0tak88r

@h0tak88r h0tak88r commented Jun 6, 2026

Copy link
Copy Markdown

No description provided.

h0tak88r and others added 2 commits June 3, 2026 19:48
Textual's copy_to_clipboard uses OSC 52, which Terminal.app does not
honor by default, so the Copy button silently did nothing. Add a
_native_clipboard_copy helper that shells out to pbcopy on macOS, clip
on Windows, and wl-copy/xclip/xsel on Linux, then falls back to OSC 52.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a JavaScript harvesting + static-analysis skill that other specialist
agents consume as their attack surface map. Produces a deterministic
js_analysis.md artifact with API endpoints, parameters, secrets,
dangerous sinks, source-map recovery, and auth/session touchpoints.

Wire into hunter, deep, and standard scan modes as a mandatory first
agent. Quick mode runs a lightweight pass (Phases 1-3 only).
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a native clipboard helper (_native_clipboard_copy) in app.py that tries platform-specific clipboard tools (pbcopy, clip, wl-copy, xclip, xsel) before falling back to Textual's built-in clipboard, and adds a new hunter scan-mode skill plus a js-analysis technology skill with corresponding JS Analysis Agent hooks across all existing scan modes.

  • app.py: Adds _native_clipboard_copy and rewires three copy call-sites to prefer it; the subprocess call is missing stdout/stderr redirection, which can produce visible terminal corruption in the Textual TUI when a clipboard tool outputs error text.
  • hunter.md / js_analysis.md: New skill documents defining an aggressive pen-test methodology and a structured JS static-analysis pipeline; no code logic concerns.
  • deep.md / standard.md / quick.md: Small additions that wire the new JS Analysis Agent as a mandatory first step in each scan mode.

Confidence Score: 3/5

The Python change in app.py introduces a subprocess that can write error text directly to the terminal, corrupting the Textual TUI display in certain Linux environments; needs the stdout/stderr fix before merging.

The clipboard subprocess runs without suppressing its output streams. On Linux, tools like wl-copy or xclip can be present on PATH yet still fail with a message to stderr (e.g., missing Wayland or X display), and that text lands on the raw terminal the TUI owns, causing visible display corruption. The five skill/mode markdown files are documentation only and carry no risk.

strix/interface/tui/app.py — specifically the _native_clipboard_copy subprocess call at lines 68–70.

Important Files Changed

Filename Overview
strix/interface/tui/app.py Adds _native_clipboard_copy helper that shells out to platform clipboard utilities as a first-pass before the Textual fallback. The subprocess call does not redirect stdout/stderr, which can corrupt the TUI display when a clipboard tool emits error output.
strix/skills/technologies/js_analysis.md New JS analysis skill document defining a six-phase methodology (collection, endpoint extraction, secret extraction, sink detection, auth inventory, hand-off notes). Well-structured with clear output contract; no code logic concerns.
strix/skills/scan_modes/hunter.md New hunter scan-mode document adding an aggressive penetration-testing methodology with six phases; includes mandatory JS Analysis Agent step and clear rules around PoC validation. Documentation only.
strix/skills/scan_modes/deep.md Minor addition: inserts a mandatory JS Analysis Agent block into the agent-strategy section of the deep scan mode. Documentation only.
strix/skills/scan_modes/standard.md Minor addition: inserts JS Analysis Agent block before vulnerability subagents in the standard scan mode. Documentation only.
strix/skills/scan_modes/quick.md Minor addition: inserts a lightweight JS Analysis Agent block (Phase 1–3 only) into the quick scan mode. Documentation only.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
strix/interface/tui/app.py:68-70
The `subprocess.run` call does not suppress `stdout` or `stderr`, so any output emitted by the clipboard tool (e.g., `wl-copy` printing `error: could not connect to display` when `WAYLAND_DISPLAY` is unset, or `xclip` printing `Error: Can't open display` when `DISPLAY` is missing) is written directly to the process's file descriptors. Because Textual owns the terminal in raw/alternate-screen mode, those writes corrupt the TUI display mid-session. Both `wl-copy` and `xclip` can be found by `shutil.which` yet still fail with stderr output if the corresponding display server is unavailable.

```suggestion
        proc = subprocess.run(
            cmd,
            input=text.encode("utf-8"),
            check=False,
            timeout=2,
            stdout=subprocess.DEVNULL,
            stderr=subprocess.DEVNULL,
        )
```

Reviews (1): Last reviewed commit: "feat(skills): add js-analysis skill and ..." | Re-trigger Greptile

Comment on lines +68 to +70
proc = subprocess.run(
cmd, input=text.encode("utf-8"), check=False, timeout=2
)

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.

P1 The subprocess.run call does not suppress stdout or stderr, so any output emitted by the clipboard tool (e.g., wl-copy printing error: could not connect to display when WAYLAND_DISPLAY is unset, or xclip printing Error: Can't open display when DISPLAY is missing) is written directly to the process's file descriptors. Because Textual owns the terminal in raw/alternate-screen mode, those writes corrupt the TUI display mid-session. Both wl-copy and xclip can be found by shutil.which yet still fail with stderr output if the corresponding display server is unavailable.

Suggested change
proc = subprocess.run(
cmd, input=text.encode("utf-8"), check=False, timeout=2
)
proc = subprocess.run(
cmd,
input=text.encode("utf-8"),
check=False,
timeout=2,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/interface/tui/app.py
Line: 68-70

Comment:
The `subprocess.run` call does not suppress `stdout` or `stderr`, so any output emitted by the clipboard tool (e.g., `wl-copy` printing `error: could not connect to display` when `WAYLAND_DISPLAY` is unset, or `xclip` printing `Error: Can't open display` when `DISPLAY` is missing) is written directly to the process's file descriptors. Because Textual owns the terminal in raw/alternate-screen mode, those writes corrupt the TUI display mid-session. Both `wl-copy` and `xclip` can be found by `shutil.which` yet still fail with stderr output if the corresponding display server is unavailable.

```suggestion
        proc = subprocess.run(
            cmd,
            input=text.encode("utf-8"),
            check=False,
            timeout=2,
            stdout=subprocess.DEVNULL,
            stderr=subprocess.DEVNULL,
        )
```

How can I resolve this? If you propose a fix, please make it concise.

- Add per-scan test_log tool (record_test/query_tests/test_log_summary)
  persisted to {state_dir}/test_log.json with merge logic, agent_history,
  tags, notes; survives --resume via hydrate on runner start
- Wire test_log tools into the base agent toolset and add an
  "ENDPOINT TEST MEMORY (REQUIRED)" block to the system prompt so every
  agent calls query_tests before testing and record_test after
- Propagate agent_name into child contexts so test_log can attribute
  entries to the spawning specialist
- Update scan_modes/{hunter,deep,standard,quick}.md to mandate the
  JS Analysis agent and call out the test memory workflow; add a
  Test-Coverage Memory section to coordination/root_agent.md
- TUI: add Activity panel (left) showing tool calls for the selected
  agent and a Plan/Todos panel (right) reading per-agent todos; wire
  refresh into the live-view tick and agent-selection change; rebalance
  layout widths in tui_styles.tcss
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