loki-mode 6.74.5 → 6.74.6

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.
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v6.74.5
6
+ # Loki Mode v6.74.6
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -272,4 +272,4 @@ The following features are documented in skill modules but not yet fully automat
272
272
  | Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
273
273
  | Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
274
274
 
275
- **v6.74.5 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
275
+ **v6.74.6 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.74.5
1
+ 6.74.6
package/autonomy/loki CHANGED
@@ -125,7 +125,7 @@ RUN_SH="$SKILL_DIR/autonomy/run.sh"
125
125
  SANDBOX_SH="$SKILL_DIR/autonomy/sandbox.sh"
126
126
  EMIT_SH="$SKILL_DIR/events/emit.sh"
127
127
  LEARNING_EMIT_SH="$SKILL_DIR/learning/emit.sh"
128
- LOKI_DIR=".loki"
128
+ LOKI_DIR="${LOKI_DIR:-.loki}"
129
129
  export LOKI_DIR
130
130
 
131
131
  # Anonymous usage telemetry
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "6.74.5"
10
+ __version__ = "6.74.6"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -2164,21 +2164,26 @@ def _get_loki_dir() -> _Path:
2164
2164
  """Get LOKI_DIR, refreshing from env on each call for consistency.
2165
2165
 
2166
2166
  Resolution order:
2167
- 1. LOKI_DIR env var (set by run.sh during active sessions)
2168
- 2. _active_project_dir (set via /api/focus API for cross-directory projects)
2167
+ 1. _active_project_dir (set via /api/focus API for cross-directory projects)
2168
+ -- takes priority because it is a runtime signal pointing to the actual
2169
+ active project, whereas LOKI_DIR is a stale startup-time value (typically
2170
+ the relative string ".loki" inherited from the CLI).
2171
+ 2. LOKI_DIR env var (only when it is an absolute path, to avoid resolving
2172
+ a relative path against the dashboard's CWD which is usually wrong)
2169
2173
  3. .loki/ in current working directory
2170
2174
  4. ~/.loki/ as global fallback
2171
2175
  """
2172
- env_dir = os.environ.get("LOKI_DIR")
2173
- if env_dir:
2174
- return _Path(env_dir)
2175
-
2176
- # Check API-set project directory (for AI Chat running in different CWD)
2176
+ # Check API-set project directory first (runtime override from /api/focus
2177
+ # or from Purple Lab / AI Chat starting a session in a different directory)
2177
2178
  if _active_project_dir:
2178
2179
  project_loki = _Path(_active_project_dir) / ".loki"
2179
2180
  if project_loki.is_dir():
2180
2181
  return project_loki
2181
2182
 
2183
+ env_dir = os.environ.get("LOKI_DIR")
2184
+ if env_dir and _Path(env_dir).is_absolute():
2185
+ return _Path(env_dir)
2186
+
2182
2187
  # Check CWD first
2183
2188
  cwd_loki = _Path.cwd() / ".loki"
2184
2189
  if cwd_loki.is_dir():
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v6.74.5
5
+ **Version:** v6.74.6
6
6
 
7
7
  ---
8
8
 
package/mcp/__init__.py CHANGED
@@ -57,4 +57,4 @@ try:
57
57
  except ImportError:
58
58
  __all__ = ['mcp']
59
59
 
60
- __version__ = '6.74.5'
60
+ __version__ = '6.74.6'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "6.74.5",
3
+ "version": "6.74.6",
4
4
  "description": "Loki Mode by Autonomi - Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "agent",
package/web-app/server.py CHANGED
@@ -2729,6 +2729,23 @@ async def start_session(req: StartRequest) -> JSONResponse:
2729
2729
  "pid": proc.pid,
2730
2730
  }})
2731
2731
 
2732
+ # Notify the Loki Dashboard (port 57374) about the active project so it
2733
+ # reads state files from the correct .loki/ directory (BUG-FOCUS-001).
2734
+ try:
2735
+ os.makedirs(os.path.join(project_dir, ".loki"), exist_ok=True)
2736
+ import urllib.request
2737
+ focus_data = json.dumps({"project_dir": project_dir}).encode()
2738
+ focus_req = urllib.request.Request(
2739
+ "http://127.0.0.1:57374/api/focus",
2740
+ data=focus_data,
2741
+ headers={"Content-Type": "application/json"},
2742
+ method="POST",
2743
+ )
2744
+ urllib.request.urlopen(focus_req, timeout=2)
2745
+ logger.info("Notified dashboard of project focus: %s", project_dir)
2746
+ except Exception:
2747
+ logger.debug("Could not notify dashboard (may not be running)")
2748
+
2732
2749
  return JSONResponse(content={
2733
2750
  "started": True,
2734
2751
  "pid": proc.pid,