@bivy/bivy 0.15.0-staging.24 → 0.15.0-staging.26
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/dist/server.js +12 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -9857,7 +9857,18 @@ app.get("/api/sessions", async (_req, res, next) => {
|
|
|
9857
9857
|
});
|
|
9858
9858
|
app.post("/api/sessions/open", async (req, res, next) => {
|
|
9859
9859
|
try {
|
|
9860
|
-
|
|
9860
|
+
// Direct transports use this endpoint for both opening a saved session and
|
|
9861
|
+
// the legacy path-only open flow. The old path-only implementation ignored
|
|
9862
|
+
// sessionId, so a direct client sending into a closed chat opened a brand-new
|
|
9863
|
+
// session instead of reopening the selected conversation.
|
|
9864
|
+
const requestedId = typeof req.body?.sessionId === "string" && req.body.sessionId.trim()
|
|
9865
|
+
? req.body.sessionId.trim()
|
|
9866
|
+
: undefined;
|
|
9867
|
+
const session = requestedId
|
|
9868
|
+
? await resolveOrResumeSession(requestedId, req.body?.path)
|
|
9869
|
+
: await createSession(defaultWorkspace, String(req.body?.path ?? ""), { runtimeId: agentFrom(req.body ?? {}) });
|
|
9870
|
+
if (!session)
|
|
9871
|
+
return res.status(404).json({ error: "Session not found" });
|
|
9861
9872
|
res.json({
|
|
9862
9873
|
id: session.id,
|
|
9863
9874
|
workspace: session.workspace,
|
package/package.json
CHANGED