← Back to PRs

#6888: feat: PowerShell completion install/uninstall + templates script + voice-call hangup fix

by ThinkIbrokeIt open 2026-02-02 05:04 View on GitHub →
docs channel: voice-call cli scripts commands agents
This PR re-introduces the work from `feat/pwsh-completion-install-uninstall` as a cleaned-up branch (`rework/pwsh-completion-install-uninstall`). It includes the following grouped changes: - feat(completion): add PowerShell automated install & uninstall (squashed) - feat: add `copy-templates` script, include it in build, and add workspace template resolution & tests - fix(voice-call): hang up rejected inbound calls and add test (squashed) Notes: - I created a backup of the original branch at `backup/feat/pwsh-completion-install-uninstall-before-reset` in the fork if you want to review the original commits. - I ran targeted tests for the changed areas: completion and voice-call tests passed locally. If you'd like, I can split these into separate PRs (completion vs templates vs voice-call) or adjust the commit messages/style per contribution guidelines. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR bundles three feature areas: (1) adds automated shell completion install/uninstall including PowerShell integration (CLI + onboarding + postinstall tests), (2) adds a `copy-templates` build step and workspace template resolution/tests, and (3) fixes voice-call behavior by hanging up rejected inbound calls with new test coverage. Key changes touch build/package metadata (`package.json`, `pnpm-lock.yaml`), new scripts under `scripts/`, CLI wiring (`src/cli/completion-cli.ts`, `src/cli/program/command-registry.ts`), and agent/workspace runtime behavior (`src/agents/*`). Main issues found: - `scripts/copy-templates.ts` uses a CommonJS entrypoint check (`require.main`) but the repo is ESM (`type: module`), which will throw at runtime and break the build. - `package.json` drops previously present `pnpm.onlyBuiltDependencies` and several `pnpm.overrides`, which likely changes install/build behavior and can undo intentional dependency pinning. - The new `sanitizeSessionHistory` API in `src/agents/pi-embedded-runner/history.ts` doesn’t actually emit sanitized content (it only counts it), so its behavior doesn’t match its name/documentation. Other notes: - The voice-call rejected-inbound hangup path can leave a persisted call record if the provider hangup fails (best-effort path); worth tightening to avoid state leakage. - Completion docs heading uses an emoji, which can create unstable Mintlify anchors. <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to a likely build-breaking ESM/CJS issue and risky package.json config regressions. - `scripts/copy-templates.ts` will throw under ESM because it references `require`, and the build now invokes it. Additionally, removal of pnpm build/override settings can change dependency resolution and native build behavior. The remaining findings are more localized behavioral issues that are probably fixable without large refactors. - scripts/copy-templates.ts, package.json, pnpm-lock.yaml, src/agents/pi-embedded-runner/history.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <details><summary><h4>Context used (3)</h4></summary> - Context from `dashboard` - docs/cli/agents.md ([source](https://app.greptile.com/review/custom-context?memory=057a11aa-5c5f-48bb-8d53-91b27b0fe3a2)) - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) </details> <!-- /greptile_comment -->

Most Similar PRs