Skip to content

fix(android): qualify Command in Termux image picker - #63

Merged
Blankeos merged 1 commit into
Blankeos:mainfrom
letwir:fix/termux
Nov 7, 2026
Merged

Blankeos merged 1 commit into
Blankeos:mainfrom
letwir:fix/termux

Conversation

@letwir

@letwir letwir commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Environment: Android / Termux / aarch64

Before: cargo install crabcode fails with E0433
After: Native build succeeds and TUI launches

Not yet tested: Image picker functionality and end-to-end agent execution

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T14:11:04.195950Z 9a0c654 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@letwir

letwir commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Screenshot_20261015-150435.png

Additional validation: Real-world Termux usage

Tested crabcode on a physical Android device running Termux (aarch64).

  • Native build and TUI launch: PASS
  • Model-backed agent interaction: PASS
  • Interactive question/selection UI: PASS
  • Sustained operation during a real development session: Observed
  • Image picker: Not yet tested

The attached screenshot shows crabcode operating interactively in Termux during an actual development workflow, rather than just launching successfully.

This provides additional evidence of practical Termux compatibility, although it does not establish full functionality across all features.

@Blankeos

Blankeos commented Nov 7, 2026

Copy link
Copy Markdown
Owner

fix/termux → main
Model: claude-sonnet-5-5, effort unknown

Confidence: 4.5/5

One-line, cfg-gated fix that is correct. I reproduced the E0433 on the base line and confirmed it compiles with the fix by force-compiling the Android-only functions on the host.
Checks run:

  • cargo fmt --check: clean.
  • cargo build (macOS aarch64): ok.
  • cargo test: 1836 passed, 3 failed, 3 ignored. The failures differ between runs: acp::service::...cancelled_stream_persists_partial_transcript... failed in the first run and custom_endpoint_failure_preserves_manual_models_and_is_cached and test_finalize_prefers_billed_output_over_sample_estimate failed in the second. All three pass in isolation, so they look flaky under parallel load. test_edit_tool_renders_codex_style_diff_summary fails in isolation because it expects README.md but gets an absolute /Users/carlo/Desktop/Projects/crabcode/README.md. That is a path-sensitive test in this environment, and unrelated to this PR since the macOS code is identical to main. Integration tests (tests/*): 7 passed.
  • Android reproduction: the Rust Android target is not installed here, so I temporarily flipped the cfg attributes in a scratch edit (non-Android fn off, both Android fns on) and ran cargo check. Base line Command::new(...): error[E0433]: cannot find type 'Command' in this scope at image_attachment.rs:269. PR head std::process::Command::new(...): cargo check finished with no errors. I reverted the scratch edit.
  • Clippy: nothing to report on the added line.
  • Screenshots do not apply (no visible change on desktop; the change only compiles on Android/Termux).

Confidence bumps:

  • A real aarch64-linux-android / Termux build and a run of the image picker (no Android toolchain or device here; cargo install also needs the NDK). This would raise the score to 5/5. The PR author says the native build succeeds and the TUI launches, but also says the image picker and an end-to-end agent run were not tested.

Summary

The Android-only paste_image_to_temp_png called Command::new("termux-storage-get"), but the file never imports std::process::Command. On Termux this was a hard compile error (E0433), so cargo install crabcode failed. The PR fully qualifies it as std::process::Command::new. The change is one line and compiled only for target_os = "android", so nothing changes on other platforms. A use std::process::Command inside the function would be slightly more idiomatic, but the qualified path is fine.

Scope: this fixes only this compile error. I could not build for Android, so other Android-only compile errors may remain, but the only other Android-gated item in the file is detected_image_extension, which has no obvious problem.

Map

flowchart LR
  A["paste_image_to_temp_png (cfg android)"] --> B["std::process::Command::new(termux-storage-get)"]
  A --> C["detected_image_extension"]
Loading

Regressions

None expected. The edit is inside a #[cfg(target_os = "android")] function, so non-Android builds are unaffected (built and tested on macOS). It is mergeable with main (clean merge-tree merge). It touches only src/utils/image_attachment.rs, and no other open PR changes that file.

Migrations

None.

Before merging

  • Optionally confirm on a real Termux device that the image picker works (the author did not test it)

@Blankeos
Blankeos merged commit 1070704 into Blankeos:main Nov 7, 2026
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