Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,9 @@ sandbox_exec() {

dcode_secret_probe() {
local command="$1"
sandbox_exec "
tmp=\$(mktemp /tmp/dcode-secret-boundary.XXXXXX)
${command} >\"\$tmp\" 2>&1
status=\$?
cat \"\$tmp\"
rm -f \"\$tmp\"
printf 'DCODE_EXIT:%s\n' \"\$status\"
exit 0
"
local remote_cmd
remote_cmd="tmp=\$(mktemp /tmp/dcode-secret-boundary.XXXXXX); ${command} >\"\$tmp\" 2>&1; status=\$?; cat \"\$tmp\"; rm -f \"\$tmp\"; printf 'DCODE_EXIT:%s\\n' \"\$status\"; exit 0"
sandbox_exec "$remote_cmd"
}

make_log_marker() {
Expand Down
2 changes: 2 additions & 0 deletions test/langchain-deepagents-code-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ describe("LangChain Deep Agents Code image contracts", () => {
expect(secretBoundaryCheck).toContain("Case: Deep Agents Code dcode secret boundary");
expect(secretBoundaryCheck).toContain("env OPENAI_API_KEY=");
expect(secretBoundaryCheck).toContain("dcode -n 'Reply with the single word PING'");
expect(secretBoundaryCheck).toContain("remote_cmd=");
expect(secretBoundaryCheck).toContain("DCODE_EXIT:%s\\\\n");
Comment on lines +438 to +442

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Avoid asserting shell implementation text here.

These checks lock the test to the script’s internal variable name and exact printf template instead of the public behavior. Assert the emitted DCODE_EXIT:<n> line or the newline-free execution contract instead. As per path instructions, “Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/langchain-deepagents-code-image.test.ts` around lines 436 - 437, The
test is asserting shell-script implementation details instead of observable
behavior. Update the checks in the relevant `secretBoundaryCheck` expectation so
they verify the emitted `DCODE_EXIT:<n>` output or the newline-free execution
contract, and remove assertions tied to the internal `remote_cmd` variable name
or the exact `printf` template. Keep the test focused on the public boundary in
`langchain-deepagents-code-image.test.ts` rather than source-text internals.

Source: Path instructions

expect(secretBoundaryCheck).toContain("DCODE_EXIT:0");
expect(secretBoundaryCheck).toContain("refusing to start");
expect(secretBoundaryCheck).toContain("NETWORK_LOG_PATTERN=");
Expand Down
Loading