Skip to content

Conversation

@yueny2020
Copy link
Contributor

@yueny2020 yueny2020 commented Apr 5, 2025

Problem

  • Add header for execute shell command

Solution

  • when shell command un-destructive, directly execute the command
    image

  • when when shell command destructive, customer can decide to run or reject the command execution
    image

-- reject
image

-- run
image


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yueny2020 yueny2020 requested a review from a team as a code owner April 5, 2025 22:13
@github-actions
Copy link

github-actions bot commented Apr 5, 2025

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@yueny2020 yueny2020 force-pushed the feature/agentic-chat branch from 29fffec to e358157 Compare April 5, 2025 22:29
@laileni-aws laileni-aws closed this Apr 5, 2025
@laileni-aws laileni-aws reopened this Apr 5, 2025
})
)
// Need separate id for read tool and safe bash command execution as 'run-shell-command' id is required to state in cwChatConnector.ts which will impact generic tool execution.
if (tool.type === ToolType.ExecuteBash) {
Copy link
Contributor

Choose a reason for hiding this comment

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

const actionId = tool.type === ToolType.ExecuteBash 
    ? 'run-shell-command' 
    : 'generic-tool-execution'

this.dispatcher.sendCustomFormActionMessage(
    new CustomFormActionMessage(tabID, { id: actionId })
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can do it in next pr.

buttons: toolUse?.name === ToolType.FsWrite ? undefined : buttons,
fullWidth: toolUse?.name === ToolType.FsWrite,
padding: !(toolUse?.name === ToolType.FsWrite),
buttons:
Copy link
Contributor

@laileni-aws laileni-aws Apr 5, 2025

Choose a reason for hiding this comment

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

We can keep buttons: undefined. Buttons is used only by fsWrite and ExecuteBash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean the current check is right, but we can simplify it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if yes, then i can do it in next pr.

id: 'confirmed-tool-use',
case 'run-shell-command':
answer.header = {
icon: 'code-block' as MynahIconsType,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need this icon and body. Please follow same approach as accept-code-diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why we don't need body and icon? or i missed some UI?

Copy link
Contributor

Choose a reason for hiding this comment

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

Use the tyrone StoreItem to get the body and icon

@laileni-aws laileni-aws changed the title feat[chat]: Add header for execute shell command feat(chat): Add header for execute shell command Apr 5, 2025
@laileni-aws laileni-aws closed this Apr 5, 2025
@laileni-aws laileni-aws reopened this Apr 5, 2025
@mr-lee mr-lee merged commit 1667c94 into aws:feature/agentic-chat Apr 7, 2025
32 of 36 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