Title: fix(copilot): stop returning generate_api_key plaintext on the in-band tool route by waleedlatif1 · Pull Request #8042 · simstudioai/sim · GitHub
Open Graph Title: fix(copilot): stop returning generate_api_key plaintext on the in-band tool route by waleedlatif1 · Pull Request #8042 · simstudioai/sim
X Title: fix(copilot): stop returning generate_api_key plaintext on the in-band tool route by waleedlatif1 · Pull Request #8042 · simstudioai/sim
Description: Summary Copilot tool results reach the model over two lanes, but the model-facing projection was applied on only one. The resume lane runs results through getToolCallTerminalData, which reduces generate_api_key to its status message; the in-band route (POST /api/copilot/tools/execute) returned the handler output verbatim, so the freshly minted plaintext workspace API key crossed to the model and into the turn transcript. The egress projection could not cover this. Its registry is a catalog of pre-existing environment and credential secrets, built once per turn, so a key minted mid-turn is invisible to it. Apply toolResultForModel at the route so both lanes return the same model-facing projection. It is an identity for every tool except generate_api_key. Behavioral note: on the in-band lane the browser's only copy of the key arrived via the relayed tool result, so the sim_key chip now renders masked there. Redacting at the shared projection instead is not an option — the main lane's client carve-out reads that same projected output, so it would break the chip everywhere. Type of Change Bug fix Testing Added regression tests on the in-band route: generate_api_key returns only the status message and no key field; a non-generate_api_key result carrying a key field is untouched; a failed call passes its error through. Verified the new test fails when the fix is reverted. vitest run app/api/copilot lib/copilot — 2636 passed, 3 skipped tsc --noEmit clean, bun run lint clean, check:audits 47/47 passing, docs-manifest:check in sync Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Copilot tool results reach the model over two lanes, but the model-facing projection was applied on only one. The resume lane runs results through getToolCallTerminalData, which reduces ge...
X Description: Summary Copilot tool results reach the model over two lanes, but the model-facing projection was applied on only one. The resume lane runs results through getToolCallTerminalData, which reduces ge...
Opengraph URL: https://github.com/simstudioai/sim/pull/8042
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:df6b6de1-46a3-2ef0-5acb-6247d702c7d1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A910:38C411:37CABD:4E2987:6AFB573D |
| html-safe-nonce | f12c9b125d8099f9fd83fec277024989a9c2be84720a5d99dc441d7c053f189b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTEwOjM4QzQxMTozN0NBQkQ6NEUyOTg3OjZBRkI1NzNEIiwidmlzaXRvcl9pZCI6IjM1OTI0NjgwNzU5MDA1MjQzNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 342cb6fd92cd73848a43f7e74d259bb1710e7d890d5115b9ba6d65acce24ca85 |
| hovercard-subject-tag | pull_request:4581264180 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8042/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Copilot tool results reach the model over two lanes, but the model-facing projection was applied on only one. The resume lane runs results through getToolCallTerminalData, which reduces ge... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width