Skip to content

Fixed config loading in pwsh and user env - #6

Open
wuerflts wants to merge 2 commits into
akatzmann:feature/experimental-powershell-supportfrom
wuerflts:fix-pwsh
Open

Fixed config loading in pwsh and user env#6
wuerflts wants to merge 2 commits into
akatzmann:feature/experimental-powershell-supportfrom
wuerflts:fix-pwsh

Conversation

@wuerflts

@wuerflts wuerflts commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Antigravity Agent and others added 2 commits July 1, 2026 20:14
* bin:
  - bin/slash-agent.ps1:
    - Sourced wrapper defining agent and /agent commands in PowerShell.
    - Captures PSReadLine or standard command history tail.
  - bin/installer.ps1:
    - Automated prerequisite checker, virtual env constructor, LLM backend config setup, and profile registration in PowerShell.
* slash_agent:
  - slash_agent/tools.py:
    - Bypassed Unix-specific PTY imports dynamically on Windows.
    - Added run_command_windows using standard subprocess pipes.
    - Added Windows carriage return (\r) stripping for status block parsing.
    - Added forward-slash path normalization and Windows system directories to filesystem guardrails.
  - slash_agent/main.py:
    - Added dynamic OS/shell/path environment awareness details to system prompt.
    - Added powershell/pwsh shell choice, pwsh_quote string escaping, and PowerShell sync file commands.
* OpenSpec:
  - Created proposal, design, specs, and tasks for experimental-powershell-support.
* docs:
  - Updated README.md with PowerShell installer and Windows native execution details.
@wuerflts

wuerflts commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Progressed to the point where powershell support generally works. However:

  • Commands are automatically executed can the approval process is currently broken.
  • An error is displayed:
    It appears there is a persistent environment error (name 'termios' is not defined) preventing the execution of standard shell commands in this session. This is likely a system-level configuration issue with the shell environment or the tool's execution bridge
  • After the agent completes a file dialoge is opened with a path like: C:\Users\wuerf\AppData\Local\Temp\tmpf5gjn0.tmp

@akatzmann
akatzmann force-pushed the feature/experimental-powershell-support branch from 0369d33 to 74463ee Compare July 13, 2026 18:15
@akatzmann

Copy link
Copy Markdown
Owner

Thanks @wuerflts!

Rebased and merged on feature/experimental-powershell-support.

Please double-check and provide feedback, so we can merge on main.

@wuerflts

Copy link
Copy Markdown
Contributor Author

Installation from a branch is currently not supported and needs manual intervention by switching the the current branch. Apart from that the integration is now mostly amazing. However, at the end of every reponse an error is displayed:

ParserError: C:\Users\wuerf\AppData\Local\Temp\acg22xtp.eah.ps1:1 Line | 1 | $env: | ~~~~~ | Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.

See also this full interaction for more context:

`/agent can you check whether you can reach google.com?
[slash-agent] Using backend 'openai'...
[slash-agent] Model 'gemma-4-12b-it-GGUF:UD-Q4_K_XL' via OpenAI-compatible endpoint.
[Agent Started Task]

[Thinking...]
The user wants me to check if I can reach google.com from the current environment.
I need to use a network-related command in PowerShell to test connectivity.
Test-NetConnection or curl (or Invoke-WebRequest) are good options.
Since I'm in a PowerShell environment, Test-NetConnection is a native and robust way to do this.

Plan:

  1. Run Test-NetConnection -ComputerName google.com to check if the host is reachable.
  2. Alternatively, I could use curl -I google.com if Test-NetConnection isn't available or preferred, but Test-NetConnection is standard in Windows PowerShell/PowerShell Core for this purpose.

Let's start with Test-NetConnection.

⚡ [Running] $ Test-NetConnection -ComputerName google.com

[Agent] Proposed Command:
$ Test-NetConnection -ComputerName google.com

[Risk: Low]

Confirm action: [y]es / [n]o / [e]edit / [c]omment ? yes
[Agent Running]: Test-NetConnection -ComputerName google.com

ComputerName : google.com
RemoteAddress : 2a00:1450:4001:c15::71
InterfaceAlias : Ethernet
SourceAddress : 2001:a62:1ab2:5a01:34b2:cf18:9a47:c6a5
PingSucceeded : True
PingReplyDetails (RTT) : 9 ms

✓ Command completed successfully
I have successfully tested the connection to google.com. The Test-NetConnection command returned PingSucceeded: True with a response time of 9 ms, confirming that the connection is reachable.
ParserError: C:\Users\wuerf\AppData\Local\Temp\acg22xtp.eah.ps1:1
Line |
1 | $env:
| ~~~~~
| Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.
`

@akatzmann

akatzmann commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Thanks @wuerflts! Should be fixed with commit 6c897ca.

Additionally, I have merged the latest changes from main (up to commit ea94c3a) to feature/experimental-powershell-support with commit 04151c9.

Once confirmed, I'll merge back to main and close PR #6.

@wuerflts

wuerflts commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

When executing tools things seem to mostly work - but apparently often an internal error occurs. E.g. when I ask the agent to look what docker containers are running:

`[Agent Running]: docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

The error name 'create_command_log_file' is not defined appears to be an internal tool error rather than a failure of the docker ps command itself. However, since I cannot proceed with the current tool setup if it's failing to log, I will try to run the command again. If it persists, I'll inform the user.

Wait, looking at the error again, it's a python error in the tool execution. I'll try running it again to see if it was a transient issue. If it fails again, I'll try to list containers using an alternative if available, but docker ps is the standard.`

Also whem a user aborts the running agent with ctrl-c currently the exceptions surface:

` File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3824.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 119, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3824.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "C:\Users\wuerf.slash-agent\slash_agent\main.py", line 561, in main_async
async for event in agent.prompt_stream(full_prompt):
...<113 lines>...
print(f"\n\033[1;31m[Agent Error]:\033[0m {getattr(event, 'content', 'Unknown error occurred')}")
File "C:\Users\wuerf.slash-agent.venv\Lib\site-packages\py_agent_core\agent.py", line 339, in prompt_stream
item = await queue.get()
^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3824.0_x64__qbz5n2kfra8p0\Lib\asyncio\queues.py", line 186, in get
await getter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 203, in _run_module_as_main
File "", line 88, in _run_code
File "C:\Users\wuerf.slash-agent\slash_agent\main.py", line 721, in
main()
~~~~^^
File "C:\Users\wuerf.slash-agent\slash_agent\main.py", line 718, in main
asyncio.run(main_async())
~~~~~~~~~~~^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3824.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 196, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3824.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 124, in run
raise KeyboardInterrupt()
KeyboardInterrupt`

I guess they could be caught and surpressed.

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