这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@K-Mistele
Copy link
Contributor

@K-Mistele K-Mistele commented Oct 16, 2025

What problem(s) was I solving?

Draft sessions were tightly coupled with active sessions in the SessionDetailRouter, making it difficult to manage their distinct behaviors and lifecycle. Users experienced issues with:

  • Draft sessions appearing in wrong UI states
  • Model settings not persisting between draft creation and launch
  • Premature draft creation when just viewing the draft launcher
  • Navigation inconsistencies when working with drafts vs active sessions

What user-facing changes did I ship?

  • Dedicated draft route: Draft sessions now load at /sessions/draft?id=XXX instead of /sessions/:id, providing clearer URL semantics
  • Lazy draft creation: Drafts are only created when users start typing or modifying settings, not when just opening the draft launcher
  • Improved model persistence: Model selection (including Baseten proxy settings) now properly saves and loads from localStorage
  • Direct navigation after launch: Launching a draft now immediately navigates to the active session view
  • Auto-refresh draft list: The draft list automatically updates when navigating back from creating/modifying drafts
  • Fixed proxy settings: Proxy configuration fields now properly appear in the UI when using custom models

How I implemented it

1. Created separate routing infrastructure

  • Added new /sessions/draft route in router.tsx with optional ?id= parameter
  • Created DraftSessionPage.tsx as a dedicated wrapper component for draft sessions
  • Modified SessionDetailRouter.tsx to redirect draft sessions to the new route
  • Renamed DraftLauncher.tsx to DraftLauncherForm.tsx for clarity

2. Fixed lazy draft creation

  • Modified DraftLauncherForm to track "dirty" state and only create drafts when content changes
  • Used refs and callbacks to prevent unnecessary re-renders and premature draft creation
  • Added proper cleanup when navigating away from empty drafts

3. Enhanced navigation flow

  • Updated 'c' hotkey in useSessionLauncher to navigate to /sessions/draft without creating a session
  • Modified SessionTablePage to route draft sessions to the dedicated draft route
  • Added immediate navigation to active session after successful launch

4. Fixed model and proxy persistence

  • Synchronized model state between ModelSelector and DraftLauncherForm components
  • Added proper localStorage loading for Baseten model configurations
  • Added missing proxy fields (proxy_enabled, proxy_base_url, proxy_model_override, proxy_api_key) to backend API responses

5. Backend improvements

  • Updated session.Info struct to include EditorState and proxy configuration fields
  • Modified GetSessionInfo and ListSessions API handlers to return all session fields
  • Fixed integration tests to use new SlashCommandSource constant format

6. Development tooling

  • Disabled ESLint react-hooks/exhaustive-deps rule to reduce false positive warnings
  • Added TanStack Form dependencies (for potential future use)

How to verify it

Manual Testing

  • New draft creation: Press 'c' from session list - should navigate to /sessions/draft without creating a session
  • Lazy creation: Open draft launcher, don't type anything, press Escape - no draft should be created
  • Draft persistence: Create draft, add content, navigate away and back - content should persist
  • Model selection: Select a custom model, create new draft - model selection should persist
  • Proxy settings: Configure Baseten proxy, save draft, reload - proxy settings should persist
  • Launch flow: Create draft, press Cmd+Enter - should immediately navigate to active session
  • Draft list refresh: Create draft, navigate back to list - new draft should appear without manual refresh
  • Existing drafts: Click existing draft in list - should load at /sessions/draft?id=XXX

Automated Testing

  • Build passes: make build
  • Tests pass: bun test - 186 tests passing, 0 failures ✓
  • Type checking: make check - All checks passing ✓
  • Linting: ESLint and Biome checks pass ✓

Description for the changelog

Fixed draft session handling with dedicated routing, lazy draft creation, and improved model persistence. Draft sessions now use /sessions/draft route and are only created when users start typing. Model and proxy settings properly persist across sessions.


Important

Separated draft and active session routes with improved draft handling and model persistence.

  • Routing:
    • Added /sessions/draft route in router.tsx for draft sessions.
    • Created DraftSessionPage.tsx for handling draft sessions.
    • Modified SessionDetailRouter.tsx to redirect drafts to the new route.
  • Draft Creation:
    • Implemented lazy draft creation in DraftLauncherForm.tsx.
    • Drafts are created only when content changes, not on opening.
  • Navigation:
    • Updated 'c' hotkey in useSessionLauncher to navigate to /sessions/draft.
    • Direct navigation to active session after draft launch.
  • Model Persistence:
    • Synchronized model state between ModelSelector and DraftLauncherForm.
    • Added localStorage support for model configurations.
  • Backend:
    • Updated session.Info struct to include proxy configuration fields.
    • Modified API handlers to return all session fields.
  • Development:
    • Disabled ESLint react-hooks/exhaustive-deps rule.
    • Updated @biomejs/biome dependency in package.json.

This description was created by Ellipsis for 223c70b. You can customize this summary. It will automatically update as commits are pushed.


Additional fixes

Slash commands in draft sessions

  • Fixed slash commands not working in draft sessions due to working directory not being passed correctly through component chain
  • Resolved closure issue where TipTap editor extensions were capturing empty initial working directory value
  • Now passes working directory ref through DraftLauncherForm → DraftLauncherInput → ResponseEditor to ensure slash commands always have access to current working directory

K-Mistele and others added 12 commits October 13, 2025 13:30
…-2304-sessiondetail-refactor-plan-d-separate-routes-with-tanstack
The constants api.Global and api.Local were renamed in PR #745 to be
values of the SlashCommandSource type. This updates the integration
tests to use the new constant format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The ListSessions API was using in-memory session.Info structs that didn't
include the EditorState field, even though it was properly stored in the
database. This caused draft session content to appear as undefined when
fetching sessions.

Added EditorState field to session.Info struct and ensured it's populated
when converting from database records in both GetSessionInfo and
ListSessions methods.
Users reported that newly created draft sessions weren't visible in the
drafts list without manually navigating to other views first.

Changes:
- Added refreshSessions() call when exiting draft launcher via Escape key
- Added refreshSessions() call when discarding empty drafts
- Auto-refresh sessions list when switching to Drafts view tab
- Refactored draft components (DraftLauncher -> DraftLauncherForm)
- Fixed routing to use dedicated /sessions/draft route for drafts

This ensures the draft list stays synchronized when users create or
modify drafts and navigate back to the list.
… draft launcher

The draft launcher was showing "Please enter a prompt before launching" even when
the editor contained text. This was due to using a stale closure value of the prompt
that was computed during render time rather than getting the current editor content
at the time of launching.

Changed to fetch the prompt directly from the store's responseEditor at the time
of validation to ensure we always check the actual current content.

Fixes the issue where existing drafts with saved content would incorrectly fail
prompt validation when trying to launch with Cmd+Enter.
Previously, launching a draft session with Cmd+Enter didn't automatically
navigate to the session due to timing issues with the status monitoring
approach. Now navigation happens immediately after successful launch.
…persist selection

The model selection was being saved to the database by ModelSelector but wasn't
updating the parent component's state. This caused DraftLauncherForm to overwrite
the selection with its stale state during auto-sync, resulting in:
- StatusBar showing "DEFAULT" after model selection
- Model selection not persisting when reopening drafts

Fixed by passing full model configuration through callbacks to keep parent state
synchronized with database changes.
The proxy configuration fields (proxy_enabled, proxy_base_url,
proxy_model_override, proxy_api_key) were stored in the database
but not being returned in ListSessions and GetSessionInfo API responses.
This caused proxy settings to appear as undefined in the frontend.
…ting drafts

Fixed timing issue where localStorage values weren't loaded before component
initialization. Now waits for localStorage to be ready before applying saved
model configurations. Also removed restrictive condition that prevented
Baseten settings from loading.
- Check for actual text content before triggering draft creation
- Only create drafts when user provides meaningful input, not on empty editor setup
- Add unified draft creation from title, editor, or working directory changes
- Optimize with refs and stable callbacks to reduce re-renders
- Add comprehensive debug logging to diagnose initialization behavior
Removed @tanstack/react-form, @tanstack/zod-form-adapter, and zod
dependencies as we decided not to use TanStack Form for the draft
launcher implementation. Also removed the unused draft.ts type
definitions file that was created for TanStack Form integration.

Additionally disabled ESLint react-hooks/exhaustive-deps rule to
reduce false positive warnings during development.
@K-Mistele K-Mistele marked this pull request as ready for review October 16, 2025 00:16
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 50b6678 in 2 minutes and 20 seconds. Click for details.
  • Reviewed 2325 lines of code in 20 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:257
  • Draft comment:
    Using an empty dependency array in handleCreateDraft is acceptable only because refs are used—but add a comment noting that daemonClient is assumed stable.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment points out something important - there is an implicit dependency on daemonClient that isn't tracked in the deps array. This could be a source of bugs if daemonClient ever becomes unstable. However, the comment is purely informational and doesn't suggest any code changes. The rules say not to make purely informative comments. The comment identifies a real potential issue with dependency tracking. But maybe it should suggest actually adding daemonClient to the deps array instead of just documenting the assumption? While adding daemonClient to deps might be better, that would be a different comment. This comment is purely informational and doesn't suggest any actual changes. The comment should be deleted because it is purely informational and doesn't suggest any concrete code changes, which violates our rules about PR comments.
2. humanlayer-wui/src/hooks/useSessionLauncher.ts:164
  • Draft comment:
    Side effects (localStorage writes) inside setConfig are fine; consider documenting the persistence strategy for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. humanlayer-wui/src/components/internal/SessionDetail/SessionDetailRouter.tsx:26
  • Draft comment:
    Ensure session.status uses the SessionStatus enum (e.g. SessionStatus.Draft) consistently rather than 'draft' literal in multiple places.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherInput.tsx:87
  • Draft comment:
    Consider handling parsing errors more gracefully in initial editor state parsing; e.g. fallback to empty state if JSON parse fails.
  • Reason this comment was not posted:
    Comment was on unchanged code.
5. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:116
  • Draft comment:
    Update API key fallback handling: ensure that if an API key isn’t provided, user feedback is consistent (possibly show disabled state).
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. humanlayer-wui/src/pages/DraftSessionPage.tsx:27
  • Draft comment:
    When filtering sessions for drafts, consider using the SessionStatus enum for clarity instead of string literal.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
7. humanlayer-wui/src/router.tsx:23
  • Draft comment:
    Route definitions now include the dedicated draft route. Confirm that any legacy references to drafts in Link components are updated accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to confirm that legacy references are updated, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue with the code.
8. package.json:14
  • Draft comment:
    Package updates (e.g. @biomejs/biome to ^2.2.6) look correct. Ensure that all workspaces have been tested with the updated version.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is purely informative and asks the PR author to ensure testing, which violates the rules. It doesn't provide a specific suggestion or point out a specific issue.
9. hld/session/manager.go:844
  • Draft comment:
    Typo note: In the TODO comment, consider using 'JSON-RPC' instead of 'JsonRPC' and 'SQLite' (capitalized) instead of 'sqlite' for consistency with common conventions.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_z6s16HFGDYh9QU9l

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

…separate-routes-with-tanstack

Resolved conflicts in daemon_slash_commands_integration_test.go by accepting
main's version using api.SlashCommandSourceGlobal and api.SlashCommandSourceLocal
constants instead of string casting.
@K-Mistele K-Mistele changed the title [ENG-2304] Separate draft and active session routes [ENG-2304,ENG-2231] Separate draft and active session routes Oct 16, 2025
Removed all DRAFT_DEBUG console.log statements that were added during
development. Kept only necessary error logging for actual error cases.
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 4ab151d in 1 minute and 7 seconds. Click for details.
  • Reviewed 282 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:103
  • Draft comment:
    Good cleanup: Removed numerous debug logs to improve clarity. Ensure that essential error logging remains for production diagnostics.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:299
  • Draft comment:
    Consider adding a cleanup for the debounced sync timer (syncTimerRef) on component unmount to avoid potential memory leaks.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherInput.tsx:78
  • Draft comment:
    Removed debug logs and standardized error logging (using logger.error) is a positive change. Ensure consistency across error messages.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. humanlayer-wui/src/pages/DraftSessionPage.tsx:38
  • Draft comment:
    For consistency, consider using a centralized logger (e.g., logger.error) instead of console.error when a draft isn’t found or fails to load.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_YLR0IoOD9Fm2Ixhv

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@K-Mistele K-Mistele changed the title [ENG-2304,ENG-2231] Separate draft and active session routes [ENG-2304,ENG-2231,ENG-2269] Separate draft and active session routes Oct 16, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 8d1de32 in 46 seconds. Click for details.
  • Reviewed 12 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:103
  • Draft comment:
    Removed an extra newline to clean up the code for better readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_RTDOg0C9F8Lltlvz

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 0dacc5a in 1 minute and 16 seconds. Click for details.
  • Reviewed 104 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/Breadcrumbs.tsx:88
  • Draft comment:
    Consider adding a comment explaining why activeSessionDetail is intentionally omitted from the dependency array in this useEffect.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:559
  • Draft comment:
    In handleDangerousSkipPermissionsConfirm, setting the dialog open to true then immediately false appears unintended. Verify the intended dialog state update.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:428
  • Draft comment:
    handleLaunchDraft uses proxyEnabled, proxyBaseUrl, and proxyModelOverride but they are missing from its dependency array. Please add them to avoid stale values.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_HqeoA6FzGSMKaTdd

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@K-Mistele K-Mistele changed the title [ENG-2304,ENG-2231,ENG-2269] Separate draft and active session routes [ENG-2304,ENG-2231,ENG-2269,ENG-2279] Separate draft and active session routes Oct 16, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 2bab2a7 in 49 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:228
  • Draft comment:
    You removed the unused 'event' parameter from the handleEditorUpdate callback. This improves clarity. Ensure that no side effects are expected from receiving an event; otherwise, this change is fine.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_6lBZseTfOdWYzowP

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@K-Mistele
Copy link
Contributor Author

this appears to have borked slash commands, working on a fix

…mands

- Pass workingDirectoryRef from DraftLauncherForm to DraftLauncherInput
- Pass workingDirRef from DraftLauncherInput to ResponseEditor
- Use ref in ResponseEditor to avoid closure issue with TipTap extensions
- Ensures slash commands receive current working directory value even when session is null
- Added debug logging to trace working directory through component chain
@K-Mistele K-Mistele marked this pull request as ready for review October 16, 2025 05:50
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 2604113 in 2 minutes and 36 seconds. Click for details.
  • Reviewed 2843 lines of code in 30 files
  • Skipped 0 files when reviewing.
  • Skipped posting 18 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/SessionDetailRouter.tsx:24
  • Draft comment:
    When a draft session is detected, the component immediately navigates to the dedicated draft route. This clear separation is good. Ensure that upstream code never inadvertently passes a draft session here.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 20% <= threshold 50% The comment is informative and suggests ensuring that upstream code does not pass a draft session inadvertently. However, it does not provide a specific code suggestion or ask for a specific test to be written. It also does not point out a specific issue with the current code. Therefore, it seems to violate the rule against asking the author to ensure behavior is intended or tested.
2. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:198
  • Draft comment:
    The lazy draft creation logic using refs (draftCreatingRef and draftCreatedRef) is clever. Verify that race conditions are fully mitigated, especially when the editor triggers multiple updates in rapid succession.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment praises the use of refs for lazy draft creation but then asks the author to verify that race conditions are mitigated. This falls under asking the author to ensure behavior is intended or to double-check things, which is against the rules.
3. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:242
  • Draft comment:
    The useEffect that loads localStorage values for model/provider persists user configuration for new drafts. Consider adding comments that clarify dependency requirements for future maintainability.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment suggests adding comments for future maintainability, which is a request for purely informative comments. This violates the rule against making purely informative comments.
4. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherInput.tsx:106
  • Draft comment:
    In the editor change handler, ensure that errors during the asynchronous update to the daemon do not block user input.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:116
  • Draft comment:
    The useEffect updating provider and model from the session ensures the modal reflects the current session state. Ensure that changes in session properties are correctly handled by the dependency array.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditor.tsx:484
  • Draft comment:
    The effectiveWorkingDirRef is correctly used to pass the current working directory to the SlashCommandList. Verify that the useEffect updating the local ref covers all edge cases when the workingDir prop changes.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that the useEffect hook covers all edge cases, which is against the rules. It does not provide a specific suggestion or point out a specific issue.
7. humanlayer-wui/src/components/internal/SessionDetail/components/StatusBar.tsx:53
  • Draft comment:
    The StatusBar displays model information by stripping provider prefixes; this is a neat UX touch. Double-check that edge cases (when model is empty) are handled gracefully.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. humanlayer-wui/src/hooks/useSessionLauncher.ts:134
  • Draft comment:
    The Zustand store for session launcher is well structured with proper localStorage persistence. Review all key names used in localStorage to avoid potential collisions.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
9. humanlayer-wui/src/lib/daemon/http-client.ts:99
  • Draft comment:
    The connection logic with retries and timeout via AbortController is robust. Consider making the timeout value configurable instead of hardcoded to 5000ms.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
10. humanlayer-wui/src/pages/DraftSessionPage.tsx:25
  • Draft comment:
    Loading an existing draft by fetching from the daemon via listSessions is practical. It might be helpful to handle the case where multiple draft sessions exist more explicitly.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The code is looking for a specific draft by ID, so multiple drafts aren't really relevant here. The comment seems speculative - it's suggesting handling a case without evidence that it's actually a problem. The current implementation correctly finds the draft with matching ID and Draft status. Maybe there are edge cases where multiple drafts could cause issues that I'm not seeing. The comment might be hinting at a real architectural concern. Without concrete evidence of problems with multiple drafts, this is a speculative comment. The code handles the core functionality correctly by finding the specific draft by ID. Delete the comment as it's speculative and suggests handling a case without evidence that it's actually problematic.
11. humanlayer-wui/src/pages/SessionTablePage.tsx:41
  • Draft comment:
    Refreshing sessions on view mode change to Drafts ensures the list stays current. Verify that this refresh does not introduce UI jank on rapid mode toggling.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that a specific behavior does not introduce UI issues, which violates the rule against asking for verification or confirmation of behavior. It does not provide a specific code suggestion or ask for a specific test to be written.
12. humanlayer-wui/src/router.tsx:22
  • Draft comment:
    Routing now cleanly separates draft sessions from active sessions via the '/sessions/draft' route; this improves URL semantics and maintainability.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining the change made in the code without providing any actionable feedback or suggestions. It doesn't ask for confirmation or suggest improvements.
13. package.json:15
  • Draft comment:
    The dependency version for @biomejs/biome is updated to '^2.2.6'. Ensure that the caret semver versioning aligns with the release strategy.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is about a dependency version change, which is not allowed according to the rules. It also asks the author to ensure alignment with the release strategy, which is similar to asking for confirmation or verification, which is not allowed.
14. test-slash-commands.md:1
  • Draft comment:
    The manual test plan is comprehensive and outlines expected behaviors for slash commands in both draft and active sessions. Great work including detailed steps and console checks.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative and praises the author for their work on the manual test plan. It does not provide any actionable feedback or suggestions for improvement.
15. humanlayer-wui/src/lib/daemon/types.ts:464
  • Draft comment:
    The transformSDKSession helper function properly adds default values such as 'dangerouslySkipPermissions'. Consider expanding this to include any new WUI fields as the integration evolves.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
16. humanlayer-wui/src/pages/SessionTablePage.tsx:40
  • Draft comment:
    Using tabs to toggle between Sessions, Drafts, and Archived in the SessionTablePage improves UX. Verify that the sessionCounts are updated correctly on session creation and updates.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that sessionCounts are updated correctly, which is against the rules. It is not making a specific code suggestion or asking for a specific test to be written. Therefore, this comment should be removed.
17. hld/session/manager.go:844
  • Draft comment:
    Typographical note: In the TODO comment, consider using 'JSON-RPC' instead of 'JsonRPC' for consistent acronym capitalization.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
18. humanlayer-wui/src/components/DebugPanel.tsx:9
  • Draft comment:
    Line 9: The import statement starts with a closing brace '}'. This looks like a typographical error. Please review whether a specific component (e.g., Dialog) was meant to be imported from '@/components/ui/dialog' or if the import should be removed/modified.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_X3ZJXQpXTV6xUmqN

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

}, [selectedIndex])

// Fetch commands from daemon
useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good debug logging around fetching slash commands and verifying the working directory. Consider removing or guarding these logs in production builds.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 199df9f in 1 minute and 10 seconds. Click for details.
  • Reviewed 37 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherInput.tsx:12
  • Draft comment:
    Explicitly importing React along with the hooks improves clarity and consistency. If you’re using the new JSX transform where an explicit React import isn’t required, consider if this extra import is necessary—but it’s a fine safeguard.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditor.tsx:484
  • Draft comment:
    The new localWorkingDirRef provides a backwards-compatible fallback when no workingDirRef is passed. Verify that this design is intentional—when a workingDirRef is provided, its value will not be updated from the workingDir prop. Otherwise, the useEffect updating localWorkingDirRef (lines 491–494) correctly keeps the local ref in sync with workingDir.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_245B1CKg6Ax41kZp

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@K-Mistele
Copy link
Contributor Author

ok this is ready for review but make sure to spend some time driving it - slash commands for draft launcher were borked and so were (are still, technically -- but will be fixed shortly) @-mentioning files from the draft launcher

Clean up console.log statements used for debugging working directory refs
and draft creation flow. Convert console.error to logger.error for proper
error handling.
@K-Mistele K-Mistele marked this pull request as draft October 16, 2025 17:38
… draft launcher

- Add optional workingDir prop to FuzzyFileMentionList interface
- Use passed workingDir as primary source, fall back to store value
- Update ResponseEditor to pass effectiveWorkingDirRef.current to component
- Apply same pattern as SlashCommandList fix for consistency
- Fix linting issue in DraftLauncherInput catch block
@K-Mistele
Copy link
Contributor Author

🐛 Bug Fix: @-mention file autocomplete in Draft Launcher

Fixed an issue where the file autocomplete (@-mentions) was not working in the Draft Launcher.

Problem

The FuzzyFileMentionList component was only reading the working directory from the global store (activeSessionDetail?.session?.workingDir). In Draft Launcher, there's no active session yet, so the component couldn't find any working directory to search files in.

Solution

Applied the same pattern that was previously used to fix slash commands:

  • Added an optional workingDir prop to FuzzyFileMentionList
  • Component now uses the passed prop as primary source, falls back to store value
  • ResponseEditor passes effectiveWorkingDirRef.current to the component
  • This ensures the working directory is available even when there's no active session

Testing

  • ✅ @-mention file autocomplete now works in Draft Launcher
  • ✅ Still works correctly in active sessions
  • ✅ Working directory changes are reflected immediately
  • ✅ Build passes with no TypeScript or linting errors

Commit: c8f929b

The ModelSelector component was attempting to call updateSession with a null
session ID when the user tried to change the model before creating a draft
(by typing in title/prompt). This fix:

- Checks if session.id exists before calling daemonClient.updateSession()
- Still calls the onModelChange callback to store settings locally
- Updates success toast messages to indicate settings are saved for new draft
- Skips session refresh when no session exists yet

The draft launcher will apply these stored model settings when the draft
is eventually created through its existing sync mechanism.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@K-Mistele K-Mistele marked this pull request as ready for review October 16, 2025 19:55
@K-Mistele
Copy link
Contributor Author

Fixed: Model selection error in draft launcher

Just pushed a fix for an issue where selecting a model in the draft launcher before typing anything would throw an error.

The Problem

When opening the draft launcher and trying to change the model through the 'select model' modal before typing anything into the title or prompt field, users would get:

RequiredError: Required parameter "id" was null or undefined when calling updateSession()

This happened because:

  • The draft launcher uses lazy creation (draft is only created when user starts typing)
  • The ModelSelector component was trying to call updateSession with a null session ID

The Solution

Modified ModelSelector.tsx to:

  1. Check if session.id exists before calling daemonClient.updateSession()
  2. Still call the onModelChange callback to store settings locally when no session exists
  3. Show appropriate toast message: "Model selection saved for new draft"
  4. Skip session data refresh when no session exists

The draft launcher's existing sync mechanism will apply these stored model settings when the draft is eventually created.

Commit: 961396c

@K-Mistele K-Mistele requested a review from dexhorthy October 16, 2025 19:58
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to c8f929b in 3 minutes and 12 seconds. Click for details.
  • Reviewed 2873 lines of code in 31 files
  • Skipped 0 files when reviewing.
  • Skipped posting 13 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/SessionDetailRouter.tsx:25
  • Draft comment:
    Good use of useEffect to redirect draft sessions. Consider adding a comment that the redirect is instantaneous to avoid accidental rendering of stale UI state.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The code already handles the redirect case well by returning null during redirect. The existing comments clearly explain the routing logic. Adding a comment about redirect timing seems unnecessary and could become outdated if React's behavior changes. The { replace: true } flag in navigate already implies this is a clean redirect. The comment might be trying to prevent future developers from adding code that could cause flicker during the redirect. The code structure with return null already prevents this issue, and the existing comments sufficiently document the behavior. Additional comments about React internals would be over-documentation. The comment should be deleted as it suggests adding unnecessary documentation when the code structure and existing comments already handle and explain the behavior well.
2. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:200
  • Draft comment:
    The lazy draft creation logic looks good. Ensure that handling of editor updates (triggering handleCreateDraft) does not fire repeatedly under rapid typing. It might be good to debounce if issues arise.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. humanlayer-wui/src/components/internal/SessionDetail/components/DraftLauncherForm.tsx:316
  • Draft comment:
    Nice use of refs to maintain mutable state (e.g. sessionIdRef). Consider a brief inline comment clarifying why session ref and localStorage are synchronized.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment appears to be confused - there isn't actually any direct synchronization between sessionIdRef and localStorage. The sessionIdRef is synchronized with the sessionId state variable, not localStorage. The comment seems to misunderstand what's happening in the code. Additionally, the code already has clear section headers and comments explaining the purpose of different sections. Could I be missing some indirect relationship between sessionIdRef and localStorage that would make this documentation valuable? Is there some non-obvious interaction I'm not seeing? No - after careful review, the comment is definitely incorrect. The sessionIdRef is only synchronized with the sessionId state variable, and this is already clearly documented with the "KEEP REFS IN SYNC WITH STATE" section header. The comment should be deleted because it is based on an incorrect understanding of the code. The synchronization that exists is already well-documented.
4. humanlayer-wui/src/components/internal/SessionDetail/components/ResponseEditor.tsx:484
  • Draft comment:
    The approach to pass and update the working directory via a local ref (effectiveWorkingDirRef) is a clean solution. Just ensure that changes to workingDir from parent are synchronized if needed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the author to ensure synchronization, which is similar to asking them to double-check or verify something. It doesn't provide a specific suggestion or point out a specific issue. It violates the rule against asking the author to ensure behavior is intended.
5. humanlayer-wui/src/lib/daemon/http-client.ts:145
  • Draft comment:
    Good refactoring to require a workingDir parameter for slash commands instead of sessionId. Validate that the backend strictly enforces correct workingDir usage.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to validate something, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue in the code.
6. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:49
  • Draft comment:
    The logic in getProviderAndModel is clear. For clarity, consider extracting provider‐specific logic into a helper function if it grows further.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. humanlayer-wui/src/hooks/useSessionLauncher.ts:63
  • Draft comment:
    The localStorage helper functions for saving model keys and provider look clean. Ensure that proper error handling is in place if localStorage access fails (e.g. in private mode).
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. humanlayer-wui/src/pages/SessionTablePage.tsx:41
  • Draft comment:
    Refreshing sessions when viewMode is drafts is a good idea. Double-check that the dependency array includes all needed setter functions for consistency (though useStore selectors are stable).
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to double-check the dependency array, which violates the rule against asking for confirmation or double-checking. It doesn't provide a specific suggestion or point out a clear issue.
9. humanlayer-wui/src/router.tsx:22
  • Draft comment:
    The route structure is now clear. The addition of /sessions/draft route helps separate draft and active sessions. Nice work.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, as it only praises the clarity of the route structure without providing any actionable feedback or suggestions. It doesn't align with the rules for useful comments.
10. package.json:15
  • Draft comment:
    Updating @biomejs/biome to ^2.2.6 is appropriate. Ensure that all team members update dependencies accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is about updating dependencies, which is not allowed according to the rules. It instructs team members to update to a specific version, which is a dependency-related comment.
11. test-slash-commands.md:1
  • Draft comment:
    The manual test plan is thorough and well-structured. It’s good to see explicit test cases for draft creation, file mentions, and navigation between drafts. It might be useful to add a note for testers regarding API key placeholders if custom models are configured.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking for a note to be added for testers, which falls under the category of asking the PR author to ensure something is tested or to provide additional information. This violates the rule against asking for confirmation or ensuring testing.
12. hld/sdk/typescript/src/generated/apis/SessionsApi.ts:702
  • Draft comment:
    Typographical issue: In the error message, the function is referenced as getSlashCommands(), but the method in this context is getSlashCommandsRaw(). Consider updating the error message for consistency.
  • Reason this comment was not posted:
    Comment was on unchanged code.
13. hld/session/manager.go:844
  • Draft comment:
    Minor Typo: In the TODO comment, consider using 'JSON-RPC' instead of 'JsonRPC' and 'SQLite' instead of 'sqlite' to match standard terminology.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_bmlQ2aZ49j8vufb5

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

await refreshSessions()
} else {
// Draft not found, navigate to new draft
console.error('Draft not found with ID:', draftId)
Copy link
Contributor

Choose a reason for hiding this comment

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

The test page uses console logging and clears activeSessionDetail on unmount. Consider adding user feedback in case the draft is not found, rather than only logging to console.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 961396c in 3 minutes and 32 seconds. Click for details.
  • Reviewed 49 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:227
  • Draft comment:
    Guard updateSession call with session.id to avoid updating undefined sessions. Ensure skipping updates for non-persistent (draft) sessions is intentional.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:254
  • Draft comment:
    Toast message logic now differentiates new draft sessions. Confirm that 'Model selection saved for new draft' is the desired message when session.id is absent.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. humanlayer-wui/src/components/internal/SessionDetail/components/ModelSelector.tsx:267
  • Draft comment:
    Conditionally refreshing session details only if session.id exists is a good defensive check. Verify that draft sessions are properly handled elsewhere.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to verify something, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue in the code. Therefore, it should be removed.

Workflow ID: wflow_ZCADIHW5q6Fo5wsp

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Updated test file to match the API change introduced in commit 2604113
where slash commands now use working_dir parameter directly instead of
looking up sessions by session_id. This fixes the failing tests in the
hld package.

- Changed all test requests to use WorkingDir field instead of SessionId
- Removed unnecessary GetSession mocking as it's no longer needed
- All tests now pass successfully
@K-Mistele K-Mistele merged commit 9da990d into main Oct 16, 2025
4 of 5 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.

3 participants