Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2892379
Deliver verified images in private Lark answers
loopx-agent Nov 14, 2026
bc7ca0a
Keep image retries behind new private Lark replies
loopx-agent Nov 14, 2026
215968b
Integrate current main for private Lark image delivery
loopx-agent Nov 14, 2026
7ca624a
Integrate current main for private Lark image recovery
loopx-agent Nov 14, 2026
c66527e
Recover missing images from one verified private Lark reply
loopx-agent Nov 14, 2026
0bc3758
Integrate private triage and image delivery on the original worker
loopx-agent Nov 14, 2026
54d2b10
Integrate current main for private Lark delivery validation
loopx-agent Nov 14, 2026
fbb9d47
Integrate current main for the private Lark worker candidate
loopx-agent Nov 14, 2026
0f651b9
Use one wall clock for private Lark image retries
loopx-agent Nov 14, 2026
b98c3ad
Recheck the original Lark reply before historical image writes
loopx-agent Nov 14, 2026
cf08b21
Include current native Steward fixtures in image recovery candidate
loopx-agent Nov 14, 2026
be0de92
Merge commit 'e96857f62d3cd546b215ed3d0823f877d5cbb29c' into codex/la…
loopx-agent Nov 14, 2026
5eb3096
Verify private Lark image sources before every redirect
loopx-agent Nov 14, 2026
028bff2
Merge commit '859a23ee9534539536343206e23452253528dd07' into codex/la…
loopx-agent Nov 14, 2026
263dd3c
Merge commit '45cfd0c86d8f24d630ab66ad7f76784faa21c3f6' into codex/la…
loopx-agent Nov 14, 2026
766791a
Recheck the historical Lark reply before each media write
loopx-agent Nov 14, 2026
f6f91b1
Retry Lark image uploads after an explicit App scope rejection
loopx-agent Nov 14, 2026
e45cdcb
Merge remote-tracking branch 'origin/main' into codex/lark-source-ima…
loopx-agent Nov 14, 2026
a2aa123
Honor original Lark stop and closure before deferred images
loopx-agent Nov 14, 2026
98f4bd4
Recheck private answer control after Lark source read
loopx-agent Nov 14, 2026
50b49e0
Merge remote-tracking branch 'origin/main' into codex/lark-source-ima…
loopx-agent Nov 14, 2026
794e711
Read the current Core session after delayed image controls
loopx-agent Nov 14, 2026
22acd4c
Merge remote-tracking branch 'origin/main' into codex/lark-source-ima…
loopx-agent Nov 14, 2026
15126d4
Fence private answer media dispatch with original controls
loopx-agent Nov 14, 2026
db69577
Keep Lark media checks with private delivery
loopx-agent Nov 14, 2026
b492101
Recheck Lark image sources after recording upload intent
loopx-agent Nov 14, 2026
9e0a6ed
Read both original Feishu messages together before media upload
loopx-agent Nov 14, 2026
a346ee3
Verify Feishu sources at the guarded image dispatch
loopx-agent Nov 14, 2026
35cb1b2
Preserve pre-dispatch Feishu source and session validation
loopx-agent Nov 14, 2026
a634df0
Recover private image uploads when the Lark CLI cannot start
loopx-agent Nov 14, 2026
3c42031
Merge remote-tracking branch 'origin/main' into codex/lark-source-ima…
loopx-agent Nov 14, 2026
e56997b
Merge commit 'af92301ab4cc67d209e64c115eb6694e3c74ceb7' into codex/la…
loopx-agent Nov 15, 2026
764c709
Recover private Lark images after a CLI descriptor limit
loopx-agent Nov 15, 2026
b9e3060
Integrate current main and keep pending Lark images visible
loopx-agent Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion loopx/canary/module_metric_baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"lines": 2760
},
"loopx/extensions/lark/private_conversations.py": {
"lines": 2213
"lines": 2583
},
"loopx/heartbeat_prompt.py": {
"any_count": 17,
Expand Down
12 changes: 6 additions & 6 deletions loopx/capabilities/native_chat/external_conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ...file_lock import exclusive_file_lock, try_exclusive_file_lock
from . import result_review_evidence
from .codex_context import checked_session_home
from .file_discovery import FileChatDiscovery, later_equivalent_source_input, source_control_fields
from .file_discovery import FileChatDiscovery, external_source_route_path, later_equivalent_source_input, source_control_fields

# Request journals are named by their 24-hex request_ref; lock metadata and
# other siblings in this directory are not requests.
Expand Down Expand Up @@ -548,7 +548,7 @@ def source_requests() -> list[dict[str, Any]]:
# route already owns the fence, leave this request unchanged for
# the existing worker's next fresh visit, rather than admitting
# from an observation that waited behind that route.
with try_exclusive_file_lock(self.root / "source-fences" / f"{row['binding_id']}.{row['source']['source_ref']}.json", operation="route_external_chat_request") as acquired:
with try_exclusive_file_lock(external_source_route_path(self.root, row["binding_id"], row["source"]["source_ref"]), operation="route_external_chat_request") as acquired:
if acquired is None:
return row
current = self.bindings.read()
Expand Down Expand Up @@ -740,7 +740,7 @@ def _recover_native_result(self, path: Path, row: dict[str, Any], session: dict[
proof = recovered.get("native_observation")
selected = self.bindings.resolve(binding_id=row["binding_id"], **row["source"], include_observation=True)
source = source_observation(selected)
with try_exclusive_file_lock(self.root / "source-fences" / f"{row['binding_id']}.{row['source']['source_ref']}.json",
with try_exclusive_file_lock(external_source_route_path(self.root, row["binding_id"], row["source"]["source_ref"]),
operation="route_external_chat_request") as acquired:
if acquired is None:
return row
Expand Down Expand Up @@ -826,8 +826,7 @@ def admit_history_answer(self, *, binding_id: str, source: dict[str, Any], reque
raise ValueError("invalid historical answer source")
path = self.root / f"{request_ref}.json"
with exclusive_file_lock(path, operation="admit_external_chat_request"):
with exclusive_file_lock(self.root / "source-fences" / f"{binding_id}.{source['source_ref']}.json",
operation="route_external_chat_request"):
with exclusive_file_lock(external_source_route_path(self.root, binding_id, source["source_ref"]), operation="route_external_chat_request"):
selected = self.bindings.resolve(binding_id=binding_id, **source, include_observation=True)
if source_preflight(deepcopy(selected)) is not None:
raise ValueError("source preflight must verify or raise")
Expand Down Expand Up @@ -1391,7 +1390,8 @@ def admit(self, *, binding_id: str, source: dict[str, Any], request_ref: str,
# A duplicate waits on its own request before taking the route fence;
# it must not hold up other messages while native cancellation runs.
with exclusive_file_lock(path, operation="admit_external_chat_request"):
with exclusive_file_lock(self.root / "source-fences" / f"{binding_id}.{source['source_ref']}.json", operation="route_external_chat_request"):
with exclusive_file_lock(external_source_route_path(self.root, binding_id, source["source_ref"]),
operation="route_external_chat_request"):
# Resolve and verify the source inside both fences before
# creating or replaying any canonical request.
selected = resolve_external_admission_source(self.bindings, binding_id, source, source_preflight)
Expand Down
5 changes: 5 additions & 0 deletions loopx/capabilities/native_chat/file_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
from typing import Any


def external_source_route_path(root: Path, binding_id: str, source_ref: str) -> Path:
"""Locate the original source's cross-process admission fence."""
return root / "source-fences" / f"{binding_id}.{source_ref}.json"


def _ordinary_request_text_digest(row: dict[str, Any]) -> str | None:
"""Match ordinary private text without retaining its body in discovery."""
message = row.get("message")
Expand Down
40 changes: 32 additions & 8 deletions loopx/extensions/lark/cli_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import shutil
import subprocess
from collections.abc import Callable, Mapping, Sequence
from contextlib import nullcontext
from dataclasses import dataclass
from pathlib import Path
from typing import Any
Expand Down Expand Up @@ -261,6 +262,8 @@ def run(
args: list[str],
cwd: Path | None = None,
timeout: float | None = None,
*,
dispatch_guard=None,
) -> dict[str, Any]:
if not resolution.available:
raise LarkCliUnavailableError(resolution.error_code or "lark_cli_not_installed")
Expand All @@ -272,19 +275,40 @@ def run(
env["PATH"] = os.pathsep.join(
[parent, *(part for part in current if part != parent)]
)
completed = subprocess_run(
args,
cwd=str(cwd) if cwd else None,
timeout=timeout,
capture_output=True,
env=env,
text=True,
)
if dispatch_guard is not None:
with dispatch_guard():
process = subprocess.Popen(
args, cwd=str(cwd) if cwd else None, env=env, text=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
)
with process:
try:
stdout, stderr = process.communicate(timeout=timeout)
except BaseException:
process.kill()
process.communicate()
raise
completed = subprocess.CompletedProcess(args, process.returncode, stdout, stderr)
else:
completed = subprocess_run(
args, cwd=str(cwd) if cwd else None, timeout=timeout,
capture_output=True, env=env, text=True,
)
return {
"returncode": completed.returncode,
"stdout": completed.stdout,
"stderr": completed.stderr,
"timed_out": False,
}

run.dispatch_guard = True
return run


def run_lark_command_with_dispatch_guard(runner, args, cwd, timeout, guard):
"""Keep the native authority fence through CLI spawn, never response IO."""
if getattr(runner, "dispatch_guard", False) is True:
return runner(args, cwd, timeout, dispatch_guard=guard)
# Injected in-process runners execute synchronously and own no subprocess.
with (guard() if guard is not None else nullcontext()):
return runner(args, cwd, timeout)
Loading
Loading