Skip to content

[fix] Give the config Files drawer its own drive scope [#6388] - #6393

Merged
ashrafchowdury merged 1 commit into
release/v0.114.7from
fix/agent-files-without-session
Sep 3, 2026
Merged

[fix] Give the config Files drawer its own drive scope [#6388]#6393
ashrafchowdury merged 1 commit into
release/v0.114.7from
fix/agent-files-without-session

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Fixes #6388.

Context

Open an agent's configuration page when no session is running, go to the Files section, and nothing works.

The listing itself is fine. StorageSection resolves the drive through useConfigDrive and hands it to the drawer as a prop, and useSessionDriveSummary already models the no-session case: with no cwd mount it treats the agent's durable folder as the whole drive.

The per-file actions are the problem. Inside the drawer, DriveFileCard and friends read the session and artifact ids from DriveSessionContext, and the only components that ever provided it are the chat surfaces: AgentChatPanel, AgentConversation, and mobile's SessionWorkspace. On a configuration page with no conversation open there is no provider anywhere in the tree, so every file resolved to no mount.

Changes

StorageSection now provides the drive scope around its own drawer instead of hoping an ancestor supplies it. It already had both ids from useConfigDrive, and the artifact id does not need a session to exist.

<DriveSessionProvider sessionId={resolvedSessionId} artifactId={artifactId ?? null}>
    <FilesDrawer ... />
</DriveSessionProvider>

The surface that resolves the drive is now the one that declares it.

Tests / notes

  • @agenta/entity-ui unit suite passes (598), lint and both app typechecks clean.
  • Not reproduced in a browser. The desktop app is not part of the local docker stack, so the failing surface could not be loaded. The diagnosis is from the code path, and it is specific: the provider genuinely does not exist above StorageSection on that page.
  • On /m this path already had an ancestor provider, so the bug never reproduced there. The nested provider resolves the same two ids, so it should be a no-op on mobile. Worth a click-through on /m's config Files section before merging, since that is the case this could regress.

What to QA

  • Open an agent that has files but no running session, go to its configuration page, open Files. The agent's files list, and opening one previews it instead of doing nothing.
  • Regression: open a session on /m, open the config pane's Files section, open a file. It behaves as before.

The drive it browses arrives as a prop, but the per-file actions inside it read
the session and artifact ids from DriveSessionContext — and the only providers
were the chat surfaces (AgentChatPanel, AgentConversation, mobile's
SessionWorkspace). On a configuration page with no conversation open there was no
provider in the tree at all, so every file resolved to no mount and the section
did nothing (#6388).

StorageSection already resolves both ids through useConfigDrive, and the artifact
one does not need a session to exist, so it now provides them around its own
drawer instead of hoping an ancestor supplies them.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 31, 2026 2:58pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Fixed file actions in the storage drawer when viewing configuration pages without an active conversation.
    • Ensured files consistently resolve to the correct storage location in these contexts.

Walkthrough

StorageSection now passes the resolved session and artifact identifiers to FilesDrawer through DriveSessionProvider, including configuration pages without an open conversation.

Changes

Configuration file access

Layer / File(s) Summary
Provide drive context to the file drawer
web/packages/agenta-entity-ui/src/drive/StorageSection.tsx
StorageSection extracts sessionId and artifactId from useConfigDrive and supplies them to DriveSessionProvider around FilesDrawer.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 9be9a

The change enables file previews and downloads from an agent configuration page without an active session. It is mergeable with explicit owner awareness: update the drawer metadata to use the resolved session ID, and confirm that existing backend ownership checks cover the newly reachable file operations.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change addresses issue #6388 by providing DriveSessionContext in StorageSection with the session and artifact IDs resolved by useConfigDrive. This enables file actions when no session is running.
Out of Scope Changes check ✅ Passed The changes are limited to the configuration Files drawer drive scope required by issue #6388. No unrelated code changes are described.
Description check ✅ Passed The description clearly explains the configuration Files drawer issue, identifies the missing DriveSessionProvider, describes the fix, and states the expected behavior and validation.
Title check ✅ Passed The title clearly identifies the main change: adding a drive scope for the configuration Files drawer. It is concise and related to issue #6388.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-files-without-session

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e8a891a7-9297-4c2e-94ab-a1712e67ae5d

📥 Commits

Reviewing files that changed from the base of the PR and between cf3b366 and 9be9a4b.

📒 Files selected for processing (1)
  • web/packages/agenta-entity-ui/src/drive/StorageSection.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.

scope: string
}) {
const {drive} = useConfigDrive(revisionId, sessionId)
const {drive, sessionId: resolvedSessionId, artifactId} = useConfigDrive(revisionId, sessionId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use resolvedSessionId for driveIds.

The provider uses resolvedSessionId, but driveIds still uses sessionId at Line 130. Without an open conversation, the drawer header can omit the resolved session owner ID. Build driveIds from resolvedSessionId and update the useMemo dependency.

Proposed fix
-                sessionId ? {key: "owner", label: "Session ID", value: sessionId} : null,
+                resolvedSessionId
+                    ? {key: "owner", label: "Session ID", value: resolvedSessionId}
+                    : null,
...
-        [drive.mount?.id, sessionId],
+        [drive.mount?.id, resolvedSessionId],

Comment on lines +279 to +284
Its own DriveSessionProvider because the drive it browses is THIS section's, not an
ancestor's. The listing arrives as a prop, but the per-file actions inside read the
ids from context — and the only providers were the chat surfaces, so on a
configuration page with no conversation open there was no context at all and the
files resolved to no mount (#6388). `useConfigDrive` already resolved both ids from
the edited revision; the artifact one does not need a session to exist. */}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Shorten the added JSX comment to one line.

Lines 279-284 add a multi-line comment. Replace it with one short line.

As per coding guidelines: “Hard rule. At most ONE short line per comment.”

Source: Coding guidelines

@ashrafchowdury
ashrafchowdury changed the base branch from main to release/v0.114.7 September 3, 2026 10:02
@ashrafchowdury
ashrafchowdury merged commit b4aa915 into release/v0.114.7 Sep 3, 2026
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) Agent configuration files are unavailable without a running session

2 participants