forgexa-cli 1.15.0__tar.gz → 1.15.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.15.0
3
+ Version: 1.15.2
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License: MIT
@@ -1,2 +1,2 @@
1
1
  """forgexa-cli — Forgexa command-line client."""
2
- __version__ = "1.15.0"
2
+ __version__ = "1.15.2"
@@ -523,7 +523,7 @@ except (ImportError, ModuleNotFoundError):
523
523
  # DAEMON_VERSION is the protocol/logic version of the daemon code.
524
524
  # Kept in sync with pyproject.toml version via bump-version.sh.
525
525
  # CLIENT_TYPE identifies which packaging/distribution this daemon runs in.
526
- DAEMON_VERSION = "1.15.0"
526
+ DAEMON_VERSION = "1.15.2"
527
527
 
528
528
 
529
529
  def _detect_client_type() -> str:
@@ -1744,10 +1744,10 @@ class WorkspaceManager:
1744
1744
  The Win32 API intercepts these names before they reach the NTFS
1745
1745
  driver, so os.unlink / shutil.rmtree / PowerShell Remove-Item all
1746
1746
  fail with a permissions or access error. The solution is the
1747
- \\?\ extended-length path prefix, which instructs Windows to
1747
+ \\?\\ extended-length path prefix, which instructs Windows to
1748
1748
  skip Win32 name parsing and pass the path directly to the NT
1749
1749
  kernel file-system layer. 'cmd /c rmdir /s /q' reliably handles
1750
- this when given a \\?\ prefixed path.
1750
+ this when given a \\?\\ prefixed path.
1751
1751
 
1752
1752
  Deletion strategy (each stage only runs if the path still exists):
1753
1753
  1. shutil.rmtree with onerror chmod — handles read-only objects.
@@ -1782,7 +1782,7 @@ class WorkspaceManager:
1782
1782
  shutil.rmtree(path, onerror=_handle_readonly)
1783
1783
 
1784
1784
  # Windows fallback: reserved device names survive shutil.rmtree.
1785
- # cmd /c rmdir /s /q with the \\?\ extended-length prefix bypasses
1785
+ # cmd /c rmdir /s /q with the \\?\\ extended-length prefix bypasses
1786
1786
  # Win32 name interception and reaches the NTFS layer directly.
1787
1787
  if path.exists() and sys.platform == "win32":
1788
1788
  try:
@@ -4900,10 +4900,47 @@ class ProcessManager:
4900
4900
  ]
4901
4901
  if reasoning and not _retry_without_effort:
4902
4902
  cmd += ["--effort", reasoning]
4903
- cmd += ["-C", str(cwd), "-p", prompt]
4904
4903
  if model_override:
4905
4904
  cmd = [agent.command, "--model", model_override] + cmd[1:]
4906
4905
 
4906
+ # On Windows, batch/cmd wrappers (e.g. copilot.BAT from the VS Code
4907
+ # Copilot Chat extension) invoke cmd.exe when run via CreateProcess.
4908
+ # cmd.exe has an ~8191-char command-line limit; long multi-line prompts
4909
+ # are silently truncated so the agent runs but never sees the output
4910
+ # file instructions — producing no required deliverables.
4911
+ # Fix: write the full prompt to a workspace-local file and pass a short
4912
+ # single-line read-instruction via -p to stay under the limit.
4913
+ _task_file: Path | None = None
4914
+ _effective_prompt = prompt
4915
+ if sys.platform == "win32" and "\n" in prompt:
4916
+ _task_file = Path(cwd) / ".forgexa-task.md"
4917
+ try:
4918
+ _task_file.write_text(prompt, encoding="utf-8")
4919
+ # Prevent accidental git commit of this ephemeral file
4920
+ _git_exclude = Path(cwd) / ".git" / "info" / "exclude"
4921
+ if _git_exclude.exists():
4922
+ _excl = _git_exclude.read_text(encoding="utf-8", errors="replace")
4923
+ if ".forgexa-task.md" not in _excl:
4924
+ _git_exclude.write_text(
4925
+ _excl.rstrip("\n") + "\n.forgexa-task.md\n", encoding="utf-8",
4926
+ )
4927
+ _effective_prompt = (
4928
+ "Read the file .forgexa-task.md for your complete task "
4929
+ "specification. Follow all instructions in it exactly."
4930
+ )
4931
+ logger.debug(
4932
+ "Copilot task %s: wrote %d-char prompt to .forgexa-task.md",
4933
+ task_id, len(prompt),
4934
+ )
4935
+ except Exception as _tf_err:
4936
+ logger.warning(
4937
+ "Copilot task %s: could not write prompt file (%s); using -p directly",
4938
+ task_id, _tf_err,
4939
+ )
4940
+ _task_file = None
4941
+
4942
+ cmd += ["-C", str(cwd), "-p", _effective_prompt]
4943
+
4907
4944
  # Log the exact invocation (redact prompt body) so operators can
4908
4945
  # reproduce failures manually and diagnose CLI version incompatibilities.
4909
4946
  _cmd_display = " ".join(
@@ -5097,6 +5134,11 @@ class ProcessManager:
5097
5134
  self.active_processes.pop(task_id, None)
5098
5135
  if _is_outer_call and _isolated_copilot_home:
5099
5136
  WorkspaceManager._safe_rmtree(Path(_isolated_copilot_home))
5137
+ if _task_file is not None:
5138
+ try:
5139
+ _task_file.unlink(missing_ok=True)
5140
+ except Exception:
5141
+ pass
5100
5142
 
5101
5143
  async def _run_generic(
5102
5144
  self, agent: DiscoveredAgent, prompt: str, cwd: Path, timeout: int, task_id: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.15.0
3
+ Version: 1.15.2
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "forgexa-cli"
3
- version = "1.15.0"
3
+ version = "1.15.2"
4
4
  description = "Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform"
5
5
  requires-python = ">=3.9"
6
6
  license = { text = "MIT" }
File without changes
File without changes