alpiecode 10.10.5__tar.gz → 10.10.8__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 (154) hide show
  1. {alpiecode-10.10.5 → alpiecode-10.10.8}/PKG-INFO +1 -1
  2. {alpiecode-10.10.5 → alpiecode-10.10.8}/pyproject.toml +1 -1
  3. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/PKG-INFO +1 -1
  4. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/__init__.py +1 -1
  5. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/agent.py +6 -2
  6. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/backends/local_backend.py +4 -3
  7. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/backends/openai_backend.py +15 -3
  8. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/chat_tags.py +7 -4
  9. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/grounding.py +4 -0
  10. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/local_model.py +12 -3
  11. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/media.py +35 -13
  12. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/orchestrator.py +1 -1
  13. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/slash.py +25 -6
  14. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/vision.py +41 -0
  15. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_report_convergence.py +1 -1
  16. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_slash_and_diff.py +36 -0
  17. {alpiecode-10.10.5 → alpiecode-10.10.8}/README.md +0 -0
  18. {alpiecode-10.10.5 → alpiecode-10.10.8}/setup.cfg +0 -0
  19. {alpiecode-10.10.5 → alpiecode-10.10.8}/setup.py +0 -0
  20. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode/__init__.py +0 -0
  21. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/SOURCES.txt +0 -0
  22. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/dependency_links.txt +0 -0
  23. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/entry_points.txt +0 -0
  24. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/requires.txt +0 -0
  25. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/alpiecode.egg-info/top_level.txt +0 -0
  26. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/__main__.py +0 -0
  27. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/assessment.py +0 -0
  28. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/backends/__init__.py +0 -0
  29. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/backends/base.py +0 -0
  30. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/blueprints.py +0 -0
  31. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/cache.py +0 -0
  32. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/capabilities.py +0 -0
  33. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/cli.py +0 -0
  34. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/client.py +0 -0
  35. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/compaction.py +0 -0
  36. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/config.py +0 -0
  37. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/context.py +0 -0
  38. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/convergence.py +0 -0
  39. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/diff_preview.py +0 -0
  40. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/discovery.py +0 -0
  41. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/doctor.py +0 -0
  42. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/dream_rsi.py +0 -0
  43. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/evaluation.py +0 -0
  44. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/executor.py +0 -0
  45. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/git_ops.py +0 -0
  46. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/github.py +0 -0
  47. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/guardian.py +0 -0
  48. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/guardrails.py +0 -0
  49. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/ipython_ext.py +0 -0
  50. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/lifecycle.py +0 -0
  51. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/memory.py +0 -0
  52. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/metrics.py +0 -0
  53. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/onboarding.py +0 -0
  54. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/paths.py +0 -0
  55. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/progress.py +0 -0
  56. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/project_template.py +0 -0
  57. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/prompt.py +0 -0
  58. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/rephraser.py +0 -0
  59. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/server.py +0 -0
  60. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/session.py +0 -0
  61. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/accessibility-audit/SKILL.md +0 -0
  62. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/accessibility-testing/SKILL.md +0 -0
  63. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/accessibility-ui-components/SKILL.md +0 -0
  64. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/agentic-workflows/SKILL.md +0 -0
  65. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/api-design/SKILL.md +0 -0
  66. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/architecture-design/SKILL.md +0 -0
  67. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/backend-engineering/SKILL.md +0 -0
  68. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/browser-automation/SKILL.md +0 -0
  69. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/cli-development/SKILL.md +0 -0
  70. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/cloud-infrastructure/SKILL.md +0 -0
  71. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/code-generation/SKILL.md +0 -0
  72. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/code-review/SKILL.md +0 -0
  73. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/codebase-onboarding/SKILL.md +0 -0
  74. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/cost-optimization/SKILL.md +0 -0
  75. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/data-analysis/SKILL.md +0 -0
  76. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/data-engineering/SKILL.md +0 -0
  77. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/database-engineering/SKILL.md +0 -0
  78. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/dependency-management/SKILL.md +0 -0
  79. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/dependency-security/SKILL.md +0 -0
  80. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/dependency-upgrades/SKILL.md +0 -0
  81. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/devops-ci-cd/SKILL.md +0 -0
  82. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/docker-containers/SKILL.md +0 -0
  83. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/documentation/SKILL.md +0 -0
  84. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/documentation-site/SKILL.md +0 -0
  85. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/e2e-testing/SKILL.md +0 -0
  86. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/error-handling-resilience/SKILL.md +0 -0
  87. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/feature-development/SKILL.md +0 -0
  88. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/frontend-engineering/SKILL.md +0 -0
  89. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/git-workflow/SKILL.md +0 -0
  90. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/incident-response/SKILL.md +0 -0
  91. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/legacy-code-modernization/SKILL.md +0 -0
  92. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/llm-application-engineering/SKILL.md +0 -0
  93. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/localization-i18n/SKILL.md +0 -0
  94. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/mcp-server-development/SKILL.md +0 -0
  95. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/migration-engineering/SKILL.md +0 -0
  96. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/mobile-development/SKILL.md +0 -0
  97. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/model-evaluation/SKILL.md +0 -0
  98. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/nodejs-services/SKILL.md +0 -0
  99. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/observability/SKILL.md +0 -0
  100. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/performance-optimization/SKILL.md +0 -0
  101. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/privacy-data-protection/SKILL.md +0 -0
  102. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/prompt-engineering/SKILL.md +0 -0
  103. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/python-engineering/SKILL.md +0 -0
  104. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/rag-retrieval/SKILL.md +0 -0
  105. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/react-engineering/SKILL.md +0 -0
  106. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/release-management/SKILL.md +0 -0
  107. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/requirements-analysis/SKILL.md +0 -0
  108. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/responsive-design/SKILL.md +0 -0
  109. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/safe-refactoring/SKILL.md +0 -0
  110. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/secure-coding/SKILL.md +0 -0
  111. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/systematic-debugging/SKILL.md +0 -0
  112. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/technical-planning/SKILL.md +0 -0
  113. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/technical-research/SKILL.md +0 -0
  114. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/technical-writing/SKILL.md +0 -0
  115. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/test-engineering/SKILL.md +0 -0
  116. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/tool-integration/SKILL.md +0 -0
  117. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/typescript-engineering/SKILL.md +0 -0
  118. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/visual-regression-testing/SKILL.md +0 -0
  119. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/web-performance/SKILL.md +0 -0
  120. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/web-security-testing/SKILL.md +0 -0
  121. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills/workflow-automation/SKILL.md +0 -0
  122. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/skills.py +0 -0
  123. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/subagent.py +0 -0
  124. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/system1.py +0 -0
  125. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/tools.py +0 -0
  126. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/updater.py +0 -0
  127. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/verifier.py +0 -0
  128. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/vscode_installer.py +0 -0
  129. {alpiecode-10.10.5 → alpiecode-10.10.8}/src/codeagent/walkthrough.py +0 -0
  130. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_adaptive_resilience.py +0 -0
  131. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_chat_tags_and_offline_multimodal.py +0 -0
  132. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_cli_ui.py +0 -0
  133. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_context_and_trajectory.py +0 -0
  134. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_deloop_and_sessions.py +0 -0
  135. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_dream_rsi.py +0 -0
  136. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_frontier_architecture.py +0 -0
  137. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_gpu_detection.py +0 -0
  138. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_lifecycle_and_portfolio.py +0 -0
  139. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_local_model_download.py +0 -0
  140. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_memory_optimization.py +0 -0
  141. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_non_thinking_and_local_stream.py +0 -0
  142. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_onboarding.py +0 -0
  143. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_project_templates.py +0 -0
  144. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_release_foundations.py +0 -0
  145. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_security_config.py +0 -0
  146. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_skills_engine.py +0 -0
  147. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_subagents.py +0 -0
  148. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_task_assessment.py +0 -0
  149. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_token_economy_and_256k.py +0 -0
  150. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_truncation_resilience.py +0 -0
  151. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_verifier.py +0 -0
  152. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_visual_grounding.py +0 -0
  153. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_walkthrough.py +0 -0
  154. {alpiecode-10.10.5 → alpiecode-10.10.8}/test/test_web_resilience_and_guardrails.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alpiecode
3
- Version: 10.10.5
3
+ Version: 10.10.8
4
4
  Summary: AlpieCode
5
5
  Requires-Python: >=3.9
6
6
  Requires-Dist: huggingface_hub>=0.20.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "alpiecode"
7
- version = "10.10.5"
7
+ version = "10.10.8"
8
8
  description = "AlpieCode"
9
9
  requires-python = ">=3.9"
10
10
  dependencies = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alpiecode
3
- Version: 10.10.5
3
+ Version: 10.10.8
4
4
  Summary: AlpieCode
5
5
  Requires-Python: >=3.9
6
6
  Requires-Dist: huggingface_hub>=0.20.0
@@ -17,7 +17,7 @@ Supports:
17
17
  from pathlib import Path
18
18
  from typing import Optional, Any, Dict
19
19
 
20
- __version__ = "10.10.5"
20
+ __version__ = "10.10.8"
21
21
 
22
22
  def run(task: str, workdir: str = ".", reasoning_level: str = "thinking", **kwargs):
23
23
  """Run an autonomous coding task programmatically."""
@@ -385,6 +385,7 @@ def run_agent(
385
385
  last_discovery = {}
386
386
  has_streamed_tokens = False
387
387
  has_printed_anything = False
388
+ last_displayed_message = ""
388
389
  task_success = True
389
390
  task_outcome = "success"
390
391
  task_failure_message = ""
@@ -659,6 +660,7 @@ def run_agent(
659
660
  has_streamed_tokens = False
660
661
  else:
661
662
  _print_assistant_message(event.data["content"])
663
+ last_displayed_message = event.data["content"].strip()
662
664
  has_printed_anything = True
663
665
  _checkpoint(workdir, "checkpoint: response")
664
666
 
@@ -808,7 +810,7 @@ def run_agent(
808
810
  sys.stdout.flush()
809
811
  has_streamed_tokens = False
810
812
  summary = event.data.get("summary", "")
811
- if summary:
813
+ if summary and summary.strip() != last_displayed_message:
812
814
  _print_assistant_message(summary)
813
815
  has_printed_anything = True
814
816
  _checkpoint(workdir, "checkpoint: done")
@@ -988,6 +990,7 @@ def run_chat(
988
990
 
989
991
  has_streamed_chat = False
990
992
  has_printed_chat = False
993
+ last_displayed_message = ""
991
994
  chat_status = CLIStatus(console, enabled=verbose)
992
995
  chat_status.start("Thinking...")
993
996
  try:
@@ -1074,6 +1077,7 @@ def run_chat(
1074
1077
  has_streamed_chat = False
1075
1078
  else:
1076
1079
  _print_assistant_message(event.data["content"])
1080
+ last_displayed_message = event.data["content"].strip()
1077
1081
  has_printed_chat = True
1078
1082
  _checkpoint(workdir, "checkpoint: done")
1079
1083
 
@@ -1111,7 +1115,7 @@ def run_chat(
1111
1115
  sys.stdout.write("\n")
1112
1116
  has_streamed_chat = False
1113
1117
  summary = event.data.get("summary", "")
1114
- if summary:
1118
+ if summary and summary.strip() != last_displayed_message:
1115
1119
  _print_assistant_message(summary)
1116
1120
  has_printed_chat = True
1117
1121
  break
@@ -51,9 +51,9 @@ class LocalBackend:
51
51
 
52
52
  @property
53
53
  def capabilities(self) -> BackendCapabilities:
54
- model_path = getattr(self._model, "model_path", None)
54
+ model_name = getattr(self._cfg, "model", None) or "alpie_seed"
55
55
  return BackendCapabilities(
56
- model=str(model_path.name if model_path else self._cfg.model_repo),
56
+ model=model_name,
57
57
  transport="gguf", mode="offline", context_window=self.context_window,
58
58
  transport_security="local",
59
59
  )
@@ -1345,7 +1345,8 @@ class AndroidBackend(BasePlatformBackend):
1345
1345
  cmd = base_cmd
1346
1346
 
1347
1347
  try:
1348
- print(f"⏳ Starting Alpie ({model_path.name}) in background...")
1348
+ display_name = getattr(self._cfg, "model", None) or "alpie_seed"
1349
+ print(f"⏳ Starting Alpie ({display_name}) in background...")
1349
1350
  print(f" Context window: {n_ctx_val} tokens | Performance cores: 4 | Lean KV cache active")
1350
1351
  subprocess.Popen(
1351
1352
  cmd,
@@ -342,8 +342,9 @@ class OpenAIBackend:
342
342
 
343
343
  @property
344
344
  def capabilities(self) -> BackendCapabilities:
345
+ display_model = getattr(self._cfg, "model", None) or "alpie_seed"
345
346
  return BackendCapabilities(
346
- model=self._resolved_model or self._cfg.model, transport="openai-compatible",
347
+ model=display_model, transport="openai-compatible",
347
348
  mode="offline" if self.is_local else "online", context_window=self.context_window,
348
349
  transport_security="local" if self.is_local else ("unknown" if not self.base_url else "tls" if self.base_url.startswith("https://") else "plaintext"),
349
350
  )
@@ -384,8 +385,19 @@ class OpenAIBackend:
384
385
  self._max_model_len = getattr(m, "max_model_len", None)
385
386
  logger.info("Resolved model: %s (max_len=%s)", self._resolved_model, self._max_model_len)
386
387
  return self._resolved_model
387
- # Preserve the explicitly selected model, including provider aliases.
388
- # An unrelated first entry must never silently replace alpie_seed.
388
+ # If configured model is alpie_seed/default and server serves alpie_9b (or another alpie variant),
389
+ # use the first served model — but only if it looks like an alpie model to avoid mapping to
390
+ # a completely unrelated model on a shared endpoint.
391
+ if models_list.data:
392
+ first_m = models_list.data[0]
393
+ first_id = getattr(first_m, "id", "") or ""
394
+ if first_id.startswith("alpie") or self._cfg.model.startswith("alpie"):
395
+ # Only auto-map when the served model is in the alpie family
396
+ if first_id.startswith("alpie"):
397
+ self._resolved_model = first_id
398
+ self._max_model_len = getattr(first_m, "max_model_len", None)
399
+ logger.info("Mapped configured model '%s' to remote served model '%s'", self._cfg.model, self._resolved_model)
400
+ return self._resolved_model
389
401
  logger.warning("Configured model is absent from discovery; using the configured ID.")
390
402
  except Exception as e:
391
403
  logger.debug("Model discovery failed (%.1fs timeout), using configured model '%s': %s",
@@ -192,12 +192,15 @@ def parse_chat_tags_and_flags(
192
192
  # Apply workdir change if valid
193
193
  if parsed["workdir"]:
194
194
  try:
195
- target_p = Path(parsed["workdir"])
196
- if not target_p.is_absolute():
197
- target_p = (current_workdir / target_p).resolve()
198
- if target_p.is_dir():
195
+ from .media import normalize_media_path
196
+ target_p = normalize_media_path(parsed["workdir"], workdir=current_workdir)
197
+ if target_p and target_p.is_dir():
199
198
  if session:
200
199
  session.workdir = target_p
200
+ if hasattr(session, "executor") and session.executor is not None:
201
+ session.executor.workdir = target_p
202
+ from .tools import make_dispatch
203
+ session.executor.dispatch = make_dispatch(target_p)
201
204
  else:
202
205
  parsed["badges"].append(f"⚠️ dir not found: {parsed['workdir']}")
203
206
  except Exception:
@@ -23,6 +23,8 @@ def video_groups(content: Any) -> List[List[Dict[str, Any]]]:
23
23
  groups.append([part])
24
24
  elif groups and part.get("type") == "image_url":
25
25
  groups[-1].append(part)
26
+ elif groups and part.get("type") == "text" and part.get("text", "").strip().startswith("[Frame "):
27
+ groups[-1].append(part)
26
28
  return groups
27
29
 
28
30
 
@@ -54,6 +56,8 @@ def identify_videos(content: Any, backend: Any, task: str = "") -> List[VideoIde
54
56
  continue
55
57
  texts = []
56
58
  for image in group[1:]:
59
+ if image.get("type") != "image_url":
60
+ continue
57
61
  try:
58
62
  raw = base64.b64decode(image["image_url"]["url"].split("base64,", 1)[1], validate=True)
59
63
  texts.append(extract_image_text(raw))
@@ -622,7 +622,8 @@ class LocalModel:
622
622
  except Exception:
623
623
  pass
624
624
 
625
- print(f"🧠 Loading local GGUF model: {model_path.name}")
625
+ display_name = "alpie_seed"
626
+ print(f"🧠 Loading local GGUF model: {display_name}")
626
627
  if mmproj_path:
627
628
  print(f" Vision Projector: {mmproj_path.name} | Handler: {type(vision_handler).__name__} (selected; encoder initializes on first image)")
628
629
  print(f" Context: {self.n_ctx} tokens | Mode: {accel} | Threads: {n_threads}")
@@ -644,6 +645,12 @@ class LocalModel:
644
645
  except Exception:
645
646
  _stderr_fd = None # Fallback: don't suppress if dup2 fails
646
647
 
648
+ try:
649
+ import llama_cpp._logger as llama_logger
650
+ llama_logger.set_verbose(False)
651
+ except Exception:
652
+ pass
653
+
647
654
  # ── Build Llama kwargs with Q8_0 KV Cache for GPU ─────────────
648
655
  llama_kwargs = dict(
649
656
  model_path=str(model_path),
@@ -677,7 +684,9 @@ class LocalModel:
677
684
  # In-Memory KV Prompt Prefix Caching for instant Turn 2+ speedup
678
685
  try:
679
686
  import llama_cpp
680
- if hasattr(llama_cpp, "LlamaRAMCache") and hasattr(self._llm, "set_cache"):
687
+ # The high-level cache is keyed by text token IDs, not image
688
+ # content. MTMD pre-fills image embeddings outside that history.
689
+ if vision_handler is None and hasattr(llama_cpp, "LlamaRAMCache") and hasattr(self._llm, "set_cache"):
681
690
  cache = llama_cpp.LlamaRAMCache(capacity_bytes=512 * 1024 * 1024)
682
691
  self._llm.set_cache(cache)
683
692
  except Exception:
@@ -808,7 +817,7 @@ class LocalModel:
808
817
  stream = kwargs.get("stream", False)
809
818
  params = {
810
819
  "messages": msgs,
811
- "temperature": 0.1 if not enable_thinking else temperature,
820
+ "temperature": min(0.1, temperature) if not enable_thinking else temperature,
812
821
  "max_tokens": max_tokens,
813
822
  "stream": stream,
814
823
  }
@@ -37,7 +37,7 @@ except ImportError:
37
37
  VIDEO_EXTENSIONS = {".mp4", ".avi", ".mov", ".mkv", ".webm", ".flv", ".wmv", ".m4v"}
38
38
  IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".webp", ".bmp", ".svg"}
39
39
  MAX_FRAMES = 8 # Max frames to extract from a video (balances context vs quality)
40
- FRAME_QUALITY = 85 # JPEG quality for extracted frames
40
+ FRAME_QUALITY = 2 # ffmpeg JPEG qscale (2 is high quality; not a percentage)
41
41
 
42
42
 
43
43
  # ── YouTube URL detection ─────────────────────────────────────────────
@@ -224,15 +224,15 @@ def extract_frames(video_path: str, max_frames: int = MAX_FRAMES) -> List[Tuple[
224
224
 
225
225
  with tempfile.TemporaryDirectory(prefix="alpiecode_frames_") as tmpdir:
226
226
  if duration and duration > 0:
227
- # Extract evenly-spaced frames across the video duration
228
- interval = duration / (max_frames + 1)
227
+ # Include the introduction: uniform interior samples previously
228
+ # skipped the first two minutes of a 16-minute review entirely.
229
+ timestamps = video_sample_times(duration, max_frames)
229
230
  frames = []
230
- for i in range(1, max_frames + 1):
231
- timestamp = interval * i
231
+ for i, timestamp in enumerate(timestamps, 1):
232
232
  out_path = os.path.join(tmpdir, f"frame_{i:03d}.jpg")
233
233
  subprocess.run(
234
234
  [ffmpeg_cmd, "-ss", f"{timestamp:.2f}", "-i", video_path,
235
- "-vframes", "1", "-q:v", str(FRAME_QUALITY // 10),
235
+ "-vframes", "1", "-q:v", str(FRAME_QUALITY),
236
236
  "-y", out_path],
237
237
  capture_output=True, timeout=30,
238
238
  )
@@ -243,6 +243,19 @@ def extract_frames(video_path: str, max_frames: int = MAX_FRAMES) -> List[Tuple[
243
243
  return _extract_frames_fallback(video_path, tmpdir, max_frames, ffmpeg_cmd)
244
244
 
245
245
 
246
+ def video_sample_times(duration: float, count: int) -> List[float]:
247
+ """Bounded still sampling, covering the introduction and the later timeline."""
248
+ if count < 1 or duration <= 0:
249
+ raise ValueError("Video duration and frame count must be positive")
250
+ if count < 3 or duration < 30:
251
+ return [duration * i / (count + 1) for i in range(1, count + 1)]
252
+ opening = min(10.0, duration * 0.1)
253
+ end = max(opening, duration - 1.0)
254
+ return [min(2.0, duration * 0.02), opening] + [
255
+ opening + (end - opening) * i / (count - 2) for i in range(1, count - 1)
256
+ ]
257
+
258
+
246
259
  def _extract_frames_fallback(video_path: str, tmpdir: str, max_frames: int, ffmpeg_cmd: str = None) -> List[Tuple[str, bytes]]:
247
260
  """Fallback: extract frames at 1 fps and pick evenly-spaced ones."""
248
261
  cmd = ffmpeg_cmd or _get_ffmpeg_cmd() or "ffmpeg"
@@ -267,12 +280,19 @@ def extract_image_text(image_bytes: bytes) -> str:
267
280
  """Return actual OCR output only; metadata and model guesses are not text evidence."""
268
281
  if shutil.which("tesseract"):
269
282
  try:
270
- result = subprocess.run(
271
- ["tesseract", "stdin", "stdout", "--oem", "1", "-l", "eng"],
272
- input=image_bytes, capture_output=True, timeout=10,
273
- )
274
- if result.returncode == 0:
275
- return result.stdout.decode("utf-8", errors="replace").strip()
283
+ # Automatic page segmentation often drops sparse badges/captions in
284
+ # photographs. Keep both document and sparse-text readings as evidence.
285
+ readings = []
286
+ for mode in (3, 11):
287
+ result = subprocess.run(
288
+ ["tesseract", "stdin", "stdout", "--oem", "1", "--psm", str(mode), "-l", "eng"],
289
+ input=image_bytes, capture_output=True, timeout=10,
290
+ )
291
+ if result.returncode == 0:
292
+ text = result.stdout.decode("utf-8", errors="replace").strip()
293
+ if text and text not in readings:
294
+ readings.append(text)
295
+ return "\n".join(readings)
276
296
  except (OSError, subprocess.TimeoutExpired):
277
297
  pass
278
298
  return ""
@@ -475,6 +495,7 @@ def build_media_content(
475
495
  )
476
496
  content.append({"type": "text", "text": header})
477
497
  for i, (mime, raw_bytes) in enumerate(frames):
498
+ content.append({"type": "text", "text": f"\n[Frame {i + 1}/{len(frames)}]\n"})
478
499
  b64 = base64.b64encode(raw_bytes).decode("utf-8")
479
500
  content.append({
480
501
  "type": "image_url",
@@ -499,7 +520,8 @@ def build_media_content(
499
520
  content.append({"type": "text", "text":
500
521
  "Video coverage: sampled still frames only; no audio or transcript was extracted. "
501
522
  "Do not claim full-video or spoken-review analysis."})
502
- for mime, raw_bytes in frames:
523
+ for i, (mime, raw_bytes) in enumerate(frames):
524
+ content.append({"type": "text", "text": f"\n[Frame {i + 1}/{len(frames)}]\n"})
503
525
  b64 = base64.b64encode(raw_bytes).decode("utf-8")
504
526
  content.append({
505
527
  "type": "image_url",
@@ -591,7 +591,7 @@ class AgentOrchestrator:
591
591
  "I could not reliably identify all models from the sampled video frames, so I cannot give a grounded buying recommendation.\n\n"
592
592
  + "\n".join(f"- {item.label}: {item.subject or 'unconfirmed'} — {item.evidence}" for item in identities)
593
593
  + "\n\nPlease provide the exact names as 'Video 1: model', 'Video 2: model', 'Video 3: model', or clear model badge/title frames. "
594
- "Only sampled still frames were available; audio and the full review were not analyzed."
594
+ + "Only sampled still frames were available; audio and the full review were not analyzed."
595
595
  + (" Current prices and independent sources cannot be checked offline." if is_offline else "")
596
596
  )
597
597
  session.context.add_user_message(task)
@@ -42,7 +42,17 @@ def handle_slash_command(
42
42
  if not clean.startswith("/"):
43
43
  if clean.lower() in ("exit", "quit", "q"):
44
44
  return False
45
- return None
45
+ # Recognize common workspace and chat commands typed without a leading slash
46
+ parts = clean.split(maxsplit=1)
47
+ first_word = parts[0].lower() if parts else ""
48
+ if first_word in (
49
+ "cd", "workdir", "pwd", "clear", "cls", "help",
50
+ "status", "diff", "undo", "doctor", "subagents",
51
+ "sessions", "init", "save"
52
+ ):
53
+ clean = "/" + clean
54
+ else:
55
+ return None
46
56
 
47
57
  cmd_parts = clean.split(maxsplit=1)
48
58
  cmd = cmd_parts[0].lower()
@@ -331,20 +341,29 @@ def handle_slash_command(
331
341
  # ── /cd, /workdir <path> ─────────────────────────────────────────────────
332
342
  if cmd in ("/cd", "/workdir"):
333
343
  if not arg:
334
- console.print(f"📂 Current working directory: [bold cyan]{workdir}[/bold cyan]" if has_rich else f"Current working directory: {workdir}")
344
+ console.print(f"📂 Current working directory: [bold cyan]{session.workdir}[/bold cyan]" if has_rich else f"Current working directory: {session.workdir}")
335
345
  return True
336
- target_p = Path(arg)
337
- if not target_p.is_absolute():
338
- target_p = (workdir / target_p).resolve()
339
- if not target_p.is_dir():
346
+ from .media import normalize_media_path
347
+ target_p = normalize_media_path(arg, workdir=Path(session.workdir))
348
+ if not target_p or not target_p.is_dir():
340
349
  console.print(f"[red]⚠️ Directory not found:[/red] {arg}" if has_rich else f"Directory not found: {arg}")
341
350
  return True
342
351
  session.workdir = target_p
352
+ # Crucial: Rebind executor workdir and tool dispatch to the new directory!
353
+ if hasattr(session, "executor") and session.executor is not None:
354
+ session.executor.workdir = target_p
355
+ from .tools import make_dispatch
356
+ session.executor.dispatch = make_dispatch(target_p)
343
357
  from .agent import _ensure_git
344
358
  _ensure_git(target_p)
345
359
  console.print(f"📂 [bold green]Switched working directory to:[/bold green] [cyan]{target_p}[/cyan]" if has_rich else f"Switched working directory to: {target_p}")
346
360
  return True
347
361
 
362
+ # ── /pwd ─────────────────────────────────────────────────────────────────
363
+ if cmd == "/pwd":
364
+ console.print(f"📂 Current working directory: [bold cyan]{session.workdir}[/bold cyan]" if has_rich else f"Current working directory: {session.workdir}")
365
+ return True
366
+
348
367
  # ── /offline, /local ─────────────────────────────────────────────────────
349
368
  if cmd in ("/offline", "/local"):
350
369
  import os
@@ -94,6 +94,47 @@ def create_vision_handler(model_path: Path, projectors: List[Path], formats: Any
94
94
  enable_thinking = True
95
95
  _alpie_native_template = True
96
96
 
97
+ def _init_mtmd_context(self, llama_model: Any) -> None:
98
+ super()._init_mtmd_context(llama_model)
99
+ # MTMD has a separate logger: verbose=False alone does not stop
100
+ # its native debug output from printing the entire user prompt.
101
+ # Share llama-cpp-python's verbosity filter; errors remain visible.
102
+ from llama_cpp._logger import llama_log_callback, set_verbose
103
+ set_verbose(False)
104
+ import llama_cpp
105
+
106
+ @llama_cpp.llama_log_callback
107
+ def _clean_log_callback(level: int, text: bytes, user_data: Any):
108
+ if b"find_slot" in text or b"non-consecutive" in text:
109
+ return
110
+ llama_log_callback(level, text, user_data)
111
+
112
+ self._mtmd_clean_log = _clean_log_callback
113
+ self._mtmd_cpp.mtmd_helper_log_set(_clean_log_callback, None)
114
+ llama_cpp.llama_log_set(_clean_log_callback, None)
115
+
116
+ def _get_template_messages(self, messages: List[Dict[str, Any]], media_marker: str) -> List[Any]:
117
+ separated = []
118
+ for message in messages:
119
+ content = message.get("content")
120
+ if isinstance(content, list):
121
+ parts = []
122
+ previous_image = False
123
+ image_number = 0
124
+ for part in content:
125
+ is_image = isinstance(part, dict) and part.get("type") == "image_url"
126
+ if is_image:
127
+ image_number += 1
128
+ if previous_image:
129
+ parts.append({"type": "text", "text": f"\n[Image {image_number}]\n"})
130
+ parts.append(part)
131
+ previous_image = is_image
132
+ message = {**message, "content": parts}
133
+ separated.append(message)
134
+ # Adjacent markers otherwise merge unrelated images into temporal
135
+ # super-frames in MTMD. Preserve each sampled still independently.
136
+ return super()._get_template_messages(separated, media_marker)
137
+
97
138
  def __call__(self, **kwargs: Any) -> Any:
98
139
  # Llama.create_chat_completion has no template-kwargs parameter.
99
140
  # MTMD accepts these kwargs and passes them into the model template.
@@ -123,7 +123,7 @@ def test_video_message_discloses_partial_coverage(tmp_path, monkeypatch):
123
123
  monkeypatch.setattr(media, "extract_frames", extractor)
124
124
  content = media.build_media_content("Compare these", video_path=[str(p) for p in paths], workdir=tmp_path)
125
125
  assert sum(part["type"] == "image_url" for part in content) == 18
126
- headers = [part["text"] for part in content if part["type"] == "text"][1:]
126
+ headers = [part["text"] for part in content if part["type"] == "text" and part["text"].startswith("--- Video ")]
127
127
  assert len(headers) == 3
128
128
  assert all("no audio or transcript" in header for header in headers)
129
129
 
@@ -76,3 +76,39 @@ def test_slash_command_routing(tmp_path: Path):
76
76
  assert handle_slash_command("/exit", session, orchestrator, cfg, console) is False
77
77
  assert handle_slash_command("exit", session, orchestrator, cfg, console) is False
78
78
  assert handle_slash_command("/quit", session, orchestrator, cfg, console) is False
79
+
80
+
81
+ def test_workdir_and_cd_commands_without_slash(tmp_path: Path):
82
+ """Verify workdir and cd typed without slash normalize WSL UNC paths and switch workdir."""
83
+ target_dir = tmp_path / "subproject"
84
+ target_dir.mkdir()
85
+
86
+ session = MagicMock()
87
+ session.workdir = tmp_path
88
+ session.executor = MagicMock()
89
+
90
+ orchestrator = MagicMock()
91
+ cfg = MagicMock()
92
+ console = MagicMock()
93
+
94
+ # 1. workdir without slash and with Windows-style WSL UNC quotes
95
+ wsl_unc = f'workdir "\\\\wsl.localhost\\Ubuntu{target_dir.as_posix()}"'
96
+ res = handle_slash_command(wsl_unc, session, orchestrator, cfg, console)
97
+ assert res is True
98
+ assert session.workdir == target_dir
99
+ assert session.executor.workdir == target_dir
100
+ assert session.executor.dispatch is not None
101
+
102
+ # 2. cd without slash
103
+ target_dir2 = tmp_path / "another_dir"
104
+ target_dir2.mkdir()
105
+ res2 = handle_slash_command(f"cd {target_dir2.as_posix()}", session, orchestrator, cfg, console)
106
+ assert res2 is True
107
+ assert session.workdir == target_dir2
108
+
109
+ # 3. pwd without slash
110
+ console.reset_mock()
111
+ res3 = handle_slash_command("pwd", session, orchestrator, cfg, console)
112
+ assert res3 is True
113
+ assert console.print.call_count >= 1
114
+
File without changes
File without changes
File without changes