aicortexpy 0.2.3__tar.gz → 0.2.4__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.
Files changed (99) hide show
  1. {aicortexpy-0.2.3/aicortexpy.egg-info → aicortexpy-0.2.4}/PKG-INFO +1 -1
  2. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/__init__.py +1 -1
  3. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/acp_conn.py +35 -5
  4. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/cli.py +10 -0
  5. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/config.py +4 -1
  6. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/daemon.py +2 -1
  7. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/runner.py +9 -1
  8. {aicortexpy-0.2.3 → aicortexpy-0.2.4/aicortexpy.egg-info}/PKG-INFO +1 -1
  9. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/pyproject.toml +1 -1
  10. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/MANIFEST.in +0 -0
  11. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/README.md +0 -0
  12. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortex/__init__.py +0 -0
  13. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortex/__main__.py +0 -0
  14. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/__main__.py +0 -0
  15. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/acp_client.py +0 -0
  16. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/acp_errors.py +0 -0
  17. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/agent_env.py +0 -0
  18. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/app_workdir.py +0 -0
  19. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/artifact_ws.py +0 -0
  20. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/artifacts.py +0 -0
  21. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/attachments.py +0 -0
  22. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/auto_commit.py +0 -0
  23. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/capabilities.py +0 -0
  24. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/chat_acp_pool.py +0 -0
  25. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/cli_context.py +0 -0
  26. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/client.py +0 -0
  27. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/codex_config.py +0 -0
  28. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/__init__.py +0 -0
  29. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/agent_cmd.py +0 -0
  30. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/attachment_cmd.py +0 -0
  31. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/auth_cmd.py +0 -0
  32. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/autopilot_cmd.py +0 -0
  33. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/config_cmd.py +0 -0
  34. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/daemon_cmd.py +0 -0
  35. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/graph_cmd.py +0 -0
  36. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/issue_cmd.py +0 -0
  37. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/label_cmd.py +0 -0
  38. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/meeting_cmd.py +0 -0
  39. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/memory_cmd.py +0 -0
  40. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/project_cmd.py +0 -0
  41. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/repo_cmd.py +0 -0
  42. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/runtime_cmd.py +0 -0
  43. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/setup_cmd.py +0 -0
  44. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/skill_cmd.py +0 -0
  45. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/squad_cmd.py +0 -0
  46. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/update_cmd.py +0 -0
  47. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/version_cmd.py +0 -0
  48. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/commands/workspace_cmd.py +0 -0
  49. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/agent-memory/SKILL.md +0 -0
  50. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicorkit-atlassian/SKILL.md +0 -0
  51. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicorkit-graph/SKILL.md +0 -0
  52. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicorkit-outlook/SKILL.md +0 -0
  53. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicorkit-wxmsg/SKILL.md +0 -0
  54. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicortex-basics/SKILL.md +0 -0
  55. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicortex-bridge-cdp/SKILL.md +0 -0
  56. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicortex-cli-ops/SKILL.md +0 -0
  57. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/aicortex-graph/SKILL.md +0 -0
  58. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/graphify/SKILL.md +0 -0
  59. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/question-form/SKILL.md +0 -0
  60. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/test-report-generator/SKILL.md +0 -0
  61. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/test-report-generator/scripts/generate_cases.py +0 -0
  62. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/data/default_skills/test-report-generator/scripts/generate_report.py +0 -0
  63. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/design_seed.py +0 -0
  64. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/diskusage.py +0 -0
  65. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/execenv.py +0 -0
  66. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/gc.py +0 -0
  67. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/handoff_bundle.py +0 -0
  68. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/health.py +0 -0
  69. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/id_resolve.py +0 -0
  70. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/local_skills.py +0 -0
  71. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/models.py +0 -0
  72. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/oauth_login.py +0 -0
  73. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/openclaw_config.py +0 -0
  74. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/output.py +0 -0
  75. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/permission.py +0 -0
  76. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/pinned_workdir.py +0 -0
  77. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/platform_client.py +0 -0
  78. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/platform_info.py +0 -0
  79. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/poisoned.py +0 -0
  80. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/process.py +0 -0
  81. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/procutil.py +0 -0
  82. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/prompt.py +0 -0
  83. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/repo.py +0 -0
  84. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/runtime_config.py +0 -0
  85. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/sandbox.py +0 -0
  86. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/security.py +0 -0
  87. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/stream.py +0 -0
  88. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/terminal.py +0 -0
  89. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/tunnel.py +0 -0
  90. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy/wakeup.py +0 -0
  91. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy.egg-info/SOURCES.txt +0 -0
  92. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy.egg-info/dependency_links.txt +0 -0
  93. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy.egg-info/entry_points.txt +0 -0
  94. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy.egg-info/requires.txt +0 -0
  95. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/aicortexpy.egg-info/top_level.txt +0 -0
  96. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/scripts/aicortex +0 -0
  97. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/scripts/aicortex.cmd +0 -0
  98. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/setup.cfg +0 -0
  99. {aicortexpy-0.2.3 → aicortexpy-0.2.4}/tests/test_app_workdir.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aicortexpy
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: AICortex Python CLI and local agent runtime daemon (Go CLI compatible)
5
5
  Author: AICortex
6
6
  License: Apache-2.0
@@ -1,3 +1,3 @@
1
1
  """AICortex Python CLI + local agent runtime daemon."""
2
2
 
3
- __version__ = "0.2.3"
3
+ __version__ = "0.2.4"
@@ -37,9 +37,20 @@ HANDSHAKE_TIMEOUT = 120.0
37
37
  PROMPT_TIMEOUT = 20 * 60.0
38
38
  STDOUT_MAX_LINE = 10 * 1024 * 1024 # match Go scanner max token
39
39
 
40
+ # UI / agent form may send these; ACP session/set_model rejects them (e.g. Cursor -32602).
41
+ _ACP_MODEL_SENTINELS = frozenset({"", "auto", "default", "none"})
42
+
40
43
  MessageCB = Callable[[dict[str, Any]], None]
41
44
 
42
45
 
46
+ def normalize_acp_model(model: str | None) -> str:
47
+ """Return a concrete model id for ACP, or '' to keep the agent default."""
48
+ m = (model or "").strip()
49
+ if m.lower() in _ACP_MODEL_SENTINELS:
50
+ return ""
51
+ return m
52
+
53
+
43
54
  @dataclass
44
55
  class ACPPromptResult:
45
56
  status: str
@@ -533,26 +544,43 @@ class _BaseACPConn:
533
544
  raise RuntimeError(f"{self.provider} acp session/new returned no session ID")
534
545
  self._session_id = session_id
535
546
  self._client.session_id = session_id
536
- self._model = model
547
+ # UI may send sentinel "auto"/"default"; ACP session/set_model rejects those.
548
+ effective_model = normalize_acp_model(model)
549
+ self._model = effective_model
537
550
  log.info("%s acp session ready session_id=%s", self.provider, session_id)
538
- if not model:
551
+ if not effective_model:
552
+ if (model or "").strip():
553
+ log.info(
554
+ "%s acp skipping set_model for sentinel model=%r",
555
+ self.provider,
556
+ model,
557
+ )
539
558
  return
540
559
  try:
541
560
  if self.model_via_config_option:
542
561
  self._client.request(
543
562
  "session/set_config_option",
544
- {"sessionId": session_id, "configId": "model", "value": model},
563
+ {
564
+ "sessionId": session_id,
565
+ "configId": "model",
566
+ "value": effective_model,
567
+ },
545
568
  timeout=handshake_timeout,
546
569
  )
547
570
  else:
548
571
  self._client.request(
549
572
  "session/set_model",
550
- {"sessionId": session_id, "modelId": model},
573
+ {"sessionId": session_id, "modelId": effective_model},
551
574
  timeout=handshake_timeout,
552
575
  )
553
576
  except Exception as e:
554
577
  if self.soft_set_model:
555
- log.debug("%s acp set_model skipped: %s", self.provider, e)
578
+ log.warning(
579
+ "%s acp set_model soft-failed model=%r: %s (continuing with agent default)",
580
+ self.provider,
581
+ effective_model,
582
+ e,
583
+ )
556
584
  return
557
585
  self.close()
558
586
  raise RuntimeError(f"{self.provider} acp set model failed: {e}") from e
@@ -561,6 +589,8 @@ class _BaseACPConn:
561
589
  class CursorACPConn(_BaseACPConn):
562
590
  provider = "cursor"
563
591
  require_set_model = True
592
+ # Prefer pooled chat over hard-failing on an unknown model id.
593
+ soft_set_model = True
564
594
 
565
595
  @classmethod
566
596
  def open(
@@ -63,11 +63,21 @@ def _setup_logging(
63
63
  level = logging.INFO
64
64
  else:
65
65
  level = logging.WARNING
66
+ # Windows consoles are often GBK; force UTF-8 so agent names like 小政 log cleanly.
67
+ for stream in (sys.stdout, sys.stderr):
68
+ reconf = getattr(stream, "reconfigure", None)
69
+ if callable(reconf):
70
+ try:
71
+ reconf(encoding="utf-8", errors="replace")
72
+ except Exception:
73
+ pass
66
74
  logging.basicConfig(
67
75
  level=level,
68
76
  format="%(asctime)s %(levelname)s %(name)s: %(message)s",
69
77
  datefmt="%H:%M:%S",
70
78
  force=True,
79
+ encoding="utf-8",
80
+ errors="replace",
71
81
  )
72
82
 
73
83
 
@@ -12,6 +12,8 @@ from dataclasses import dataclass, field
12
12
  from pathlib import Path
13
13
  from typing import Any
14
14
 
15
+ from . import __version__ as _PKG_VERSION
16
+
15
17
 
16
18
  DEFAULT_SERVER_URL = "http://localhost:8080"
17
19
  DEFAULT_POLL_INTERVAL = 30.0
@@ -27,7 +29,8 @@ DEFAULT_CHAT_ACP_IDLE_TIMEOUT = 300.0
27
29
  DEFAULT_CHAT_ACP_MAX_CONNECTIONS = 50
28
30
  DEFAULT_AGENT_IDLE_WATCHDOG = 300.0 # 5m; 0 disables
29
31
  DEFAULT_CODEX_SEMANTIC_INACTIVITY = 600.0 # 10m; 0 disables
30
- CLI_VERSION = "0.2.0-python"
32
+
33
+ CLI_VERSION = f"{_PKG_VERSION}-python"
31
34
 
32
35
  # provider -> (env path override, default binary name, model env)
33
36
  # Keep in sync with server/internal/daemon/config.go probe list.
@@ -645,7 +645,8 @@ class Daemon:
645
645
  if is_poisoned:
646
646
  fail_reason = poisoned_reason
647
647
 
648
- if result.ok:
648
+ if result.ok and not task.chat_session_id:
649
+ # Chat turns should not auto-commit into the user's project worktree.
649
650
  try:
650
651
  auto_commit_and_push(
651
652
  result.work_dir, task.id, str(agent_name)
@@ -432,7 +432,10 @@ def run_agent(
432
432
  cleanup_plan(plan)
433
433
  _cleanup_mcp_tmp(mcp_tmp)
434
434
  return acp_result
435
- log.warning("%s chat acp pool failed, falling back to one-shot backend", provider)
435
+ log.warning(
436
+ "%s chat acp pool failed, falling back to one-shot backend",
437
+ provider,
438
+ )
436
439
 
437
440
  # Non-chat ACP providers (kiro/hermes/kimi/dsh) — always JSON-RPC, not argv prompt.
438
441
  if provider in ACP_ONESHOT_PROVIDERS:
@@ -929,6 +932,11 @@ def _run_via_acp_pool(
929
932
 
930
933
  # Open failed → caller falls back to one-shot.
931
934
  if result.status == "failed" and "chat acp open failed" in (result.error or ""):
935
+ log.warning(
936
+ "%s chat acp open failed (will fall back): %s",
937
+ provider,
938
+ result.error,
939
+ )
932
940
  return None
933
941
 
934
942
  # Resume failed before a session was established → retry fresh once.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aicortexpy
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: AICortex Python CLI and local agent runtime daemon (Go CLI compatible)
5
5
  Author: AICortex
6
6
  License: Apache-2.0
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  # PyPI + import + console script entry for full Go CLI replacement.
7
7
  name = "aicortexpy"
8
- version = "0.2.3"
8
+ version = "0.2.4"
9
9
  description = "AICortex Python CLI and local agent runtime daemon (Go CLI compatible)"
10
10
  readme = "README.md"
11
11
  license = { text = "Apache-2.0" }
File without changes
File without changes
File without changes
File without changes
File without changes