alpiecode 7.0.2__tar.gz → 7.0.3__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.
- {alpiecode-7.0.2 → alpiecode-7.0.3}/PKG-INFO +1 -1
- {alpiecode-7.0.2 → alpiecode-7.0.3}/pyproject.toml +1 -1
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/PKG-INFO +1 -1
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/__init__.py +1 -1
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/backends/openai_backend.py +30 -1
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/extension/alpiecode.vsix +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/orchestrator.py +8 -5
- {alpiecode-7.0.2 → alpiecode-7.0.3}/README.md +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/setup.cfg +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode/__init__.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/SOURCES.txt +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/dependency_links.txt +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/entry_points.txt +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/requires.txt +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/alpiecode.egg-info/top_level.txt +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/agent.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/backends/__init__.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/backends/base.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/backends/local_backend.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/cache.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/cli.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/client.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/compaction.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/config.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/context.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/discovery.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/doctor.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/executor.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/git_ops.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/github.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/guardian.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/ipython_ext.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/local_model.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/media.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/memory.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/progress.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/prompt.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/rephraser.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/server.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/session.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/tools.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/updater.py +0 -0
- {alpiecode-7.0.2 → alpiecode-7.0.3}/src/codeagent/vscode_installer.py +0 -0
|
@@ -111,9 +111,38 @@ class OpenAIBackend:
|
|
|
111
111
|
)
|
|
112
112
|
|
|
113
113
|
reasoning = getattr(msg, "reasoning", None) or getattr(msg, "reasoning_content", None)
|
|
114
|
+
content = msg.content or ""
|
|
115
|
+
|
|
116
|
+
# Extract embedded thinking/reasoning if not provided in separate fields
|
|
117
|
+
if not reasoning and content:
|
|
118
|
+
import re
|
|
119
|
+
if "</think>" in content:
|
|
120
|
+
# Handled when model starts thinking implicitly or with <think>
|
|
121
|
+
parts = content.split("</think>", 1)
|
|
122
|
+
reasoning = parts[0].replace("<think>", "").strip()
|
|
123
|
+
content = parts[1].strip()
|
|
124
|
+
elif "<think>" in content:
|
|
125
|
+
think_match = re.search(r"<think>(.*?)</think>", content, flags=re.DOTALL)
|
|
126
|
+
if think_match:
|
|
127
|
+
reasoning = think_match.group(1).strip()
|
|
128
|
+
content = re.sub(r"<think>.*?</think>", "", content, flags=re.DOTALL).strip()
|
|
129
|
+
elif content.strip().lower().startswith("thinking process:") or "\nthinking process:" in content.lower():
|
|
130
|
+
if tool_calls:
|
|
131
|
+
reasoning = re.sub(r"(?i)^thinking process:\s*", "", content).strip()
|
|
132
|
+
content = ""
|
|
133
|
+
else:
|
|
134
|
+
code_match = re.search(r"\n(?=```|Here is|Below is|I will|The following|DONE:|#!/usr|/\*|package\s|import\s[a-z]|from\s[a-z])", content, flags=re.IGNORECASE)
|
|
135
|
+
if code_match:
|
|
136
|
+
think_part = content[:code_match.start()]
|
|
137
|
+
content_part = content[code_match.start():]
|
|
138
|
+
reasoning = re.sub(r"(?i)^thinking process:\s*", "", think_part).strip()
|
|
139
|
+
content = content_part.strip()
|
|
140
|
+
else:
|
|
141
|
+
reasoning = re.sub(r"(?i)^thinking process:\s*", "", content).strip()
|
|
142
|
+
content = ""
|
|
114
143
|
|
|
115
144
|
return ChatResponse(
|
|
116
|
-
content=
|
|
145
|
+
content=content,
|
|
117
146
|
reasoning=reasoning,
|
|
118
147
|
tool_calls=tool_calls,
|
|
119
148
|
raw=resp,
|
|
Binary file
|
|
@@ -61,7 +61,7 @@ class AgentOrchestrator:
|
|
|
61
61
|
|
|
62
62
|
# ── Phase 0: Discovery — pre-compute task intelligence ──
|
|
63
63
|
task_context = build_task_context(task, session.workdir)
|
|
64
|
-
complexity = task_context.complexity
|
|
64
|
+
complexity = complexity or task_context.complexity
|
|
65
65
|
|
|
66
66
|
yield AgentEvent("discovery", {
|
|
67
67
|
"intent": task_context.intent,
|
|
@@ -159,10 +159,13 @@ class AgentOrchestrator:
|
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
# ── Adaptive thinking ──
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
if cfg.enable_thinking:
|
|
163
|
+
enable_thinking = True
|
|
164
|
+
else:
|
|
165
|
+
enable_thinking = task_context.enable_thinking
|
|
166
|
+
if enable_thinking and complexity in ("qa", "low"):
|
|
167
|
+
enable_thinking = False
|
|
168
|
+
yield AgentEvent("adaptive_mode", {"message": "Simple task detected, skipping deep reasoning."})
|
|
166
169
|
|
|
167
170
|
# ── Goal-driven turn loop (no fixed limit) ──
|
|
168
171
|
progress_monitor = ProgressMonitor()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|