Repository navigation
Commit 11a5257
Neo auto-approve switch (#22950)
## Summary
Adds the Neo TUI affordances for the cloud's approval / permission modes
and fixes the stuck-prompt bug that fell out of the first slice.
- `--approval-mode` (`manual` / `balanced` / `auto`) and
`--permission-mode` (`default` / `read-only`) flags on `pulumi neo`,
hot-toggleable mid-session via Ctrl+A and Ctrl+R; status-bar chips
reflect any non-default value. Mid-session toggles PATCH the live task
so the cloud `ApprovalHandler` picks up the change without restarting.
- Wires the synthetic `user_confirmation` event the cloud emits on
auto-resolve through `forwardUserInputToUI` → a new `UIApprovalResolved`
event. The TUI now clears its pending question/approval prompt and
commits an `Auto-approved` / `Auto-answered` / `Auto-denied` breadcrumb
to scrollback. The manual path already clears state locally on Enter, so
echoes of our own confirmation no-op.
Fixes pulumi/pulumi-service#41318
Fixes pulumi/pulumi-service#41323
## Test plan
- [x] Added appropriate unit tests - For all changes
- [ ] Added a test in `pkg/engine/lifecycletest` - For all
engine/protocol changes
- [ ] Added a conformance test in `pkg/testing/pulumi-test-language` -
For language protocol changes
- [ ] Added a golden test in `pkg/backend/display` - For changes to the
output renderers
New tests cover: `UpdateNeoTask` PATCH shape, parser validation for both
new flags, Ctrl+A / Ctrl+R cycling pre- and post-message,
`outboundEvent.update` routing in the dispatcher, the new
`UIApprovalResolved` wire-routing path (including unknown-type drop and
denied case), the `blockApprovalAuto` handler (auto-approved / question
/ denied / echo-noop / mismatched-id), and the renderer verb variants.
## Validation
- [x] `make lint` — clean
- [x] `make test_fast` — `pkg/cmd/pulumi/neo/...` and
`pkg/backend/httpstate/client/...` clean (full sweep blocked locally by
a Go toolchain cache mismatch unrelated to this PR; verified on focused
packages after `go clean -cache`)
- [ ] `make tidy_fix` — clean
- [x] `make format` — clean
- [ ] Relevant SDK tests pass (if SDK changes)
- [ ] `make check_proto` — clean (if proto changes)
## Changelog
- [x] Changelog entry added —
`changelog/pending/20260507--cli-neo--surface-approval-and-permission-modes.yaml`.
## Risk
CLI-only change, gated behind the experimental `pulumi neo` command. The
mode plumbing reuses the existing `apitype.CreateAgentTaskRequest` /
`apitype.UpdateTaskRequest` wire shapes — empty mode fields are
`omitempty` so existing call sites are unaffected. The new
`forwardUserInputToUI` discriminator drops unknown user-input subtypes
silently, matching the previous "empty content" behaviour, so no other
inbound paths regress.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>1 parent 3dd972c commit 11a5257
11 files changed
Lines changed: 1427 additions & 82 deletions
File tree
- changelog/pending
- pkg
- backend/httpstate/client
- cmd/pulumi/neo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
| |||
89 | 106 | | |
90 | 107 | | |
91 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
| |||
1712 | 1732 | | |
1713 | 1733 | | |
1714 | 1734 | | |
1715 | | - | |
1716 | | - | |
| 1735 | + | |
1717 | 1736 | | |
1718 | 1737 | | |
1719 | 1738 | | |
| 1739 | + | |
1720 | 1740 | | |
1721 | 1741 | | |
1722 | 1742 | | |
1723 | 1743 | | |
1724 | | - | |
1725 | | - | |
| 1744 | + | |
1726 | 1745 | | |
1727 | 1746 | | |
1728 | 1747 | | |
| |||
1742 | 1761 | | |
1743 | 1762 | | |
1744 | 1763 | | |
| 1764 | + | |
1745 | 1765 | | |
1746 | 1766 | | |
1747 | 1767 | | |
| |||
1764 | 1784 | | |
1765 | 1785 | | |
1766 | 1786 | | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1767 | 1812 | | |
1768 | 1813 | | |
1769 | 1814 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1067 | 1185 | | |
1068 | 1186 | | |
1069 | 1187 | | |
| |||
0 commit comments