Separate research Harness session identity
Browse files- research/app_jobs.py +5 -0
- research/app_observability.py +2 -2
- research/research_runner.py +2 -2
research/app_jobs.py
CHANGED
|
@@ -85,6 +85,11 @@ class ResearchJob:
|
|
| 85 |
def artifact_id(self) -> str:
|
| 86 |
return self.workspace_id or self.id
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
def add_event(
|
| 89 |
self,
|
| 90 |
message: str,
|
|
|
|
| 85 |
def artifact_id(self) -> str:
|
| 86 |
return self.workspace_id or self.id
|
| 87 |
|
| 88 |
+
@property
|
| 89 |
+
def harness_session_id(self) -> str:
|
| 90 |
+
"""Keep model persistence separate from job and artifact identities."""
|
| 91 |
+
return f"{self.id}-research"
|
| 92 |
+
|
| 93 |
def add_event(
|
| 94 |
self,
|
| 95 |
message: str,
|
research/app_observability.py
CHANGED
|
@@ -264,7 +264,7 @@ def export_trace(job: ResearchJob, home: Path) -> None:
|
|
| 264 |
)
|
| 265 |
result = exporter.export(
|
| 266 |
ExportRequest(
|
| 267 |
-
target=job.
|
| 268 |
agent_name="research",
|
| 269 |
output_path=output_path,
|
| 270 |
)
|
|
@@ -344,7 +344,7 @@ def archive_session(
|
|
| 344 |
f"Refusing to archive sessions to public bucket {target.bucket_id!r}."
|
| 345 |
)
|
| 346 |
|
| 347 |
-
session_dir = home / "sessions" / job.
|
| 348 |
if not session_dir.is_dir():
|
| 349 |
raise FileNotFoundError(f"Session directory does not exist: {session_dir}")
|
| 350 |
for source in sorted(path for path in session_dir.rglob("*") if path.is_file()):
|
|
|
|
| 264 |
)
|
| 265 |
result = exporter.export(
|
| 266 |
ExportRequest(
|
| 267 |
+
target=job.harness_session_id,
|
| 268 |
agent_name="research",
|
| 269 |
output_path=output_path,
|
| 270 |
)
|
|
|
|
| 344 |
f"Refusing to archive sessions to public bucket {target.bucket_id!r}."
|
| 345 |
)
|
| 346 |
|
| 347 |
+
session_dir = home / "sessions" / job.harness_session_id
|
| 348 |
if not session_dir.is_dir():
|
| 349 |
raise FileNotFoundError(f"Session directory does not exist: {session_dir}")
|
| 350 |
for source in sorted(path for path in session_dir.rglob("*") if path.is_file()):
|
research/research_runner.py
CHANGED
|
@@ -62,7 +62,7 @@ class ResearchRunner:
|
|
| 62 |
try:
|
| 63 |
async with self.harness.app().open(
|
| 64 |
AppOpenRequest(
|
| 65 |
-
session_id=job.
|
| 66 |
agent="research",
|
| 67 |
metadata={
|
| 68 |
"job_id": job.id,
|
|
@@ -74,7 +74,7 @@ class ResearchRunner:
|
|
| 74 |
AgentRequest.text(
|
| 75 |
job.topic,
|
| 76 |
agent="research",
|
| 77 |
-
session_id=job.
|
| 78 |
auth=auth,
|
| 79 |
params=RequestParams(
|
| 80 |
tool_execution_handler=JobProgressHandler(job),
|
|
|
|
| 62 |
try:
|
| 63 |
async with self.harness.app().open(
|
| 64 |
AppOpenRequest(
|
| 65 |
+
session_id=job.harness_session_id,
|
| 66 |
agent="research",
|
| 67 |
metadata={
|
| 68 |
"job_id": job.id,
|
|
|
|
| 74 |
AgentRequest.text(
|
| 75 |
job.topic,
|
| 76 |
agent="research",
|
| 77 |
+
session_id=job.harness_session_id,
|
| 78 |
auth=auth,
|
| 79 |
params=RequestParams(
|
| 80 |
tool_execution_handler=JobProgressHandler(job),
|