Skip to content

fix: show full error when terminal installation fails#2070

Merged
bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom
bajrangCoder:show-terminal-install-failure
Apr 28, 2026
Merged

fix: show full error when terminal installation fails#2070
bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom
bajrangCoder:show-terminal-install-failure

Conversation

@bajrangCoder
Copy link
Copy Markdown
Member

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR refactors Terminal.js to use async/await throughout, accumulates stderr lines into lastInstallError for richer failure messages, and extracts a shared formatError helper that is also consumed by the new formatInstallLog in terminalManager.js. The two previously-noted issues (stderr accumulation and duplicated formatError logic) are now addressed.

Confidence Score: 4/5

Safe to merge; only a minor unhandled-rejection gap in the non-install startup path.

No P0 or P1 issues found. A single P2 style issue (missing .catch() on the non-install Executor chain) is the only concern. Core installation error-reporting logic is correct and the previously flagged issues have been resolved.

src/plugins/terminal/www/Terminal.js — non-install else branch of startAxs

Important Files Changed

Filename Overview
src/plugins/terminal/www/Terminal.js Major refactor: async/await, Promise-wrapped helpers, accumulated stderr in lastInstallError, and exported formatError. Non-install else branch lacks a .catch() on the Executor.start chain.
src/components/terminal/terminalManager.js Adds formatInstallLog helper and rest-param err_logger; reads Terminal.lastInstallError on non-zero exit. Logic is correct given new Terminal.js contract.

Sequence Diagram

sequenceDiagram
    participant TM as terminalManager.js
    participant T as Terminal.js
    participant E as Executor

    TM->>T: install(logger, err_logger)
    Note over T: lastInstallError = ""
    T->>T: uninstall, download, extract
    T->>T: startAxs(installing=true)
    T->>E: Executor.start("sh", callback)
    E-->>T: uuid
    T->>E: Executor.write(uuid, init-sandbox.sh)
    loop stderr events
        E-->>T: type=stderr, data
        Note over T: lastError accumulates lines
    end
    E-->>T: type=exit, data
    alt exit code 0
        T-->>TM: true
        TM-->>TM: return success
    else non-zero exit
        Note over T: lastInstallError = exit code + lastError
        T-->>TM: false
        TM-->>TM: return error from lastInstallError
    end
Loading

Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile

Comment thread src/plugins/terminal/www/Terminal.js
Comment thread src/components/terminal/terminalManager.js
@bajrangCoder

This comment was marked as outdated.

@bajrangCoder bajrangCoder merged commit fa02c4d into Acode-Foundation:main Apr 28, 2026
7 checks passed
@bajrangCoder bajrangCoder deleted the show-terminal-install-failure branch April 28, 2026 16:54
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