Skip to content

Feat: adds interactive-session pause#302

Open
l-mansouri wants to merge 41 commits intomainfrom
ia-stop
Open

Feat: adds interactive-session pause#302
l-mansouri wants to merge 41 commits intomainfrom
ia-stop

Conversation

@l-mansouri
Copy link
Collaborator

Overview

This PR implements the cloudos interactive-session pause command

JIRA

https://lifebit.atlassian.net/browse/LP-105730

Changes

  • Implements the pause command
  • Refactors documentation

Acceptance Criteria

Please add here as many scenarios as in the Story

Normally this acceptance criteria is tested in ADAPT workspace in PROD

Scenario 1: Successfully pause a running IA session #### Jupyter Screenshot 2026-03-20 at 11 59 19 #### vscode Screenshot 2026-03-20 at 12 00 59

Rstudio

Screenshot 2026-03-20 at 12 00 13

spark

Screenshot 2026-03-20 at 12 02 43

check status

Screenshot 2026-03-20 at 12 08 20
Scenario 2: Attempt to pause an already paused session Screenshot 2026-03-20 at 12 20 08
Scenario 3: Force pause a session Screenshot 2026-03-20 at 12 22 10
Scenario 4: Attempt to pause a session with a non-existent session ID Screenshot 2026-03-20 at 12 20 42

Comment on lines +964 to +966
# Display final status
transformed_data = transform_session_response(final_response)
format_stop_success_output(transformed_data, wait=True)
Copy link

Choose a reason for hiding this comment

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

Bug: The pause_session command with --wait passes incorrectly structured data to format_stop_success_output, causing the success message to display incorrect session details.
Severity: MEDIUM

Suggested Fix

Update format_stop_success_output to handle the transformed data structure, using the keys id, cost, and runtime. Alternatively, pass the raw, untransformed API response to format_stop_success_output within the pause_session function.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: cloudos_cli/interactive_session/cli.py#L964-L966

Potential issue: When the `cloudos interactive-session pause --wait` command is used,
the `pause_session` function passes transformed data to the `format_stop_success_output`
function. However, `format_stop_success_output` expects raw API response data. It
attempts to access keys like `_id`, `totalCostInUsd`, and `totalRunningTimeInSeconds`,
but the transformed data contains `id`, `cost`, and `runtime` instead. This mismatch
causes the success message to display incorrect information, showing the Session ID as
"Unknown", Total Cost as "$0.00", and an incorrect runtime.

Did we get this right? 👍 / 👎 to inform future reviews.

@l-mansouri l-mansouri changed the title Ia stop Feat: adda insteractive-session pause Mar 20, 2026
@l-mansouri l-mansouri changed the title Feat: adda insteractive-session pause Feat: adda interactive-session pause Mar 20, 2026
@l-mansouri l-mansouri changed the title Feat: adda interactive-session pause Feat: adds interactive-session pause Mar 20, 2026
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.

1 participant