Skip to content

fix: disable take_screenshot tool and remove screenshot references from system prompt for lightpanda engine - #150

Merged
edenreich merged 4 commits into
mainfrom
fix/issue-149
Jul 30, 2026
Merged

fix: disable take_screenshot tool and remove screenshot references from system prompt for lightpanda engine#150
edenreich merged 4 commits into
mainfrom
fix/issue-149

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #149

Summary

When the browser engine is configured as lightpanda, the take_screenshot tool was still registered and available to the agent, but it would always fail at runtime because lightpanda has no graphical rendering engine. This change conditionally disables the tool and removes screenshot-related instructions from the system prompt when lightpanda is detected.

Changes

  • Added isLightpanda check in main.go by comparing the configured engine against the playwright.Lightpanda constant
  • Conditionally register the take_screenshot tool only when the engine supports screenshots (chromium, firefox, webkit); log a skip message for lightpanda
  • Built the system prompt dynamically: screenshot-related content (capability [FEATURE] Implement extract_data skill #5, "screenshot" in the DOM interaction hint, and the "IMPORTANT - Artifact Creation" section about screenshots) is omitted when the engine is lightpanda
  • The runtime guard in playwright.go's TakeScreenshot method (which returns a descriptive error for lightpanda) is preserved as a safety net

@edenreich

Copy link
Copy Markdown
Contributor

@infer can you fix this? use /adl

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/deepseek-v4-flash · View Job

Todos

  • Read the ADL skill instructions
  • Read current main.go and agent.yaml to understand the current state
  • Read the full diff to see what's already been changed
  • Check .adl-ignore and understand the ADL contract for this project
  • Add main.go to .adl-ignore to protect hand-edited changes from regeneration
  • Update agent.yaml system prompt to reflect conditional screenshot support
  • Update agent.yaml skill descriptions to note take_screenshot is conditional
  • Update skill SKILL.md files to note take_screenshot is conditional on engine
  • Run checks and commit

Pull Request

#150

✅ Infer Result: Success

Everything is clean and pushed. The PR #150 now has two commits that together provide a complete, ADL-compliant fix for the lightpanda screenshot issue.

Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 2m 57s

Tokens: 2,333,214 in · 13,033 out · 2,346,247 total (29 requests)

Tool calls: 37 total · 100% success rate

Traces
Session: 1785452597-1dc3c54d

session (standard, success)                 2m55s
├── chat ollama_cloud/deepseek-v4-flash      2.4s
├── execute_tool TodoWrite call_wot1xjig    119µs
├── chat ollama_cloud/deepseek-v4-flash      4.4s
├── execute_tool Bash call_l3kedgor           5ms
├── execute_tool Read call_c997kznx         442µs
├── execute_tool Read call_6ri802xn         578µs
├── execute_tool Read call_rooy23hr         471µs
├── chat ollama_cloud/deepseek-v4-flash      8.7s
├── execute_tool TodoWrite call_zndxd77b     73µs
├── chat ollama_cloud/deepseek-v4-flash      3.8s
├── execute_tool Read call_5tp4axcn         597µs
├── execute_tool Bash call_srqx5jkm           6ms
├── execute_tool Bash call_9qp8ud6c           5ms
├── chat ollama_cloud/deepseek-v4-flash     37.6s
├── execute_tool Read call_ptwyhr8i         280µs
├── execute_tool Read call_6djajwrf         206µs
├── execute_tool Read call_442osyzi         148µs
├── execute_tool Read call_helra6w6         142µs
├── chat ollama_cloud/deepseek-v4-flash     12.3s
├── execute_tool TodoWrite call_l06cqm5z     79µs
├── chat ollama_cloud/deepseek-v4-flash      8.2s
├── execute_tool Edit call_ns1cfmt9         292µs
├── chat ollama_cloud/deepseek-v4-flash      5.8s
├── execute_tool Edit call_ivvwnppj         572µs
├── chat ollama_cloud/deepseek-v4-flash      4.4s
├── execute_tool TodoWrite call_elt1eoht    113µs
├── chat ollama_cloud/deepseek-v4-flash      4.1s
├── chat ollama_cloud/deepseek-v4-flash      3.2s
├── execute_tool Edit call_jx6abzqj         753µs
├── chat ollama_cloud/deepseek-v4-flash      2.6s
├── execute_tool Edit call_9w0ome4x         632µs
├── chat ollama_cloud/deepseek-v4-flash      4.0s
├── execute_tool TodoWrite call_es6jymnx    105µs
├── chat ollama_cloud/deepseek-v4-flash      4.2s
├── execute_tool Edit call_2n53t5so         326µs
├── chat ollama_cloud/deepseek-v4-flash      3.1s
├── execute_tool Edit call_cb660jco         344µs
├── chat ollama_cloud/deepseek-v4-flash      9.2s
├── execute_tool Edit call_iaywr2e6         292µs
├── chat ollama_cloud/deepseek-v4-flash      2.8s
├── execute_tool Edit call_6h9en9vs         385µs
├── chat ollama_cloud/deepseek-v4-flash      4.5s
├── execute_tool TodoWrite call_bwpppjkp    104µs
├── chat ollama_cloud/deepseek-v4-flash      2.6s
├── chat ollama_cloud/deepseek-v4-flash      2.2s
├── execute_tool Bash call_wp3fa5qo          2.7s
├── chat ollama_cloud/deepseek-v4-flash      1.9s
├── execute_tool Bash call_tgozue2g          9.2s
├── chat ollama_cloud/deepseek-v4-flash      2.1s
├── execute_tool Bash call_788nbrig           4ms
├── chat ollama_cloud/deepseek-v4-flash      1.9s
├── execute_tool Bash call_sof0btgg           8ms
├── chat ollama_cloud/deepseek-v4-flash      2.6s
├── execute_tool Bash call_4m7cfim2          10ms
├── chat ollama_cloud/deepseek-v4-flash      1.7s
├── execute_tool Bash call_t4e9ieb7          1.1s
├── chat ollama_cloud/deepseek-v4-flash      3.5s
├── execute_tool TodoWrite call_1k5ihp4n     78µs
├── chat ollama_cloud/deepseek-v4-flash      4.6s
├── chat ollama_cloud/deepseek-v4-flash      2.5s
├── execute_tool Bash call_ny0rwsyo           5ms
├── execute_tool Bash call_egazwg85           6ms
├── chat ollama_cloud/deepseek-v4-flash      2.9s
╰── chat ollama_cloud/deepseek-v4-flash      7.7s
Stats
Tool Calls

╭───────────┬───────┬───────┬────────╮
│ Tool      │ Calls │ Fail% │ Avg    │
├───────────┼───────┼───────┼────────┤
│ Bash      │ 11    │ 0%    │ 1190ms │
│ Read      │ 8     │ 0%    │ 0ms    │
│ Edit      │ 8     │ 0%    │ 0ms    │
│ TodoWrite │ 7     │ 0%    │ 0ms    │
╰───────────┴───────┴───────┴────────╯

Token Usage

╭────────────────────────────────┬─────────┬────────┬────────────┬─────────┬──────╮
│ Model                          │ Prompt  │ Cached │ Completion │ Total   │ Cost │
├────────────────────────────────┼─────────┼────────┼────────────┼─────────┼──────┤
│ ollama_cloud/deepseek-v4-flash │ 2439065 │ 0      │ 13072      │ 2452137 │ -    │
╰────────────────────────────────┴─────────┴────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ standard │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

Comment thread agent.yaml Outdated
Co-authored-by: Eden Reich <eden.reich@gmail.com>
@edenreich

edenreich commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@infer Let's keep it simple just update the system prompt - no need to update each skill - a small instruction in the system prompt is enough, also remove the changes from the main.go let it get generated. use /adl

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/deepseek-v4-flash · View Job

Todos

  • Read current state: diff, agent.yaml, .adl-ignore, and skill files
  • Read the ADL skill instructions
  • Revert changes to skill files (.agents/skills/*/SKILL.md)
  • Remove main.go from .adl-ignore so ADL can regenerate it
  • Update agent.yaml system prompt with lightpanda screenshot instruction
  • Run ADL generate --overwrite to regenerate main.go
  • Stage all changes, run checks, commit, and push

Pull Request

#150

✅ Infer Result: Success

Everything is clean and pushed. The PR #150 is up to date with the simplified approach: a small lightpanda note in the system prompt, skill files reverted to origin/main, and main.go regenerated by ADL.

Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 2m 25s

Tokens: 1,602,863 in · 8,728 out · 1,611,591 total (30 requests)

Tool calls: 35 total · 100% success rate

Traces
Session: 1785453612-3503b42b

session (standard, success)                 2m24s
├── chat ollama_cloud/deepseek-v4-flash      3.9s
├── execute_tool TodoWrite call_l5e6v0yc     99µs
├── chat ollama_cloud/deepseek-v4-flash      2.0s
├── execute_tool Read call_kx7a4eau         172µs
├── execute_tool Bash call_dnrndgbn           6ms
├── execute_tool Read call_rzpb6s6o         383µs
├── execute_tool Bash call_vzms5bzw           4ms
├── chat ollama_cloud/deepseek-v4-flash      3.5s
├── execute_tool Read call_7e29dh8h         573µs
├── execute_tool Bash call_gwq5ivrc           6ms
├── chat ollama_cloud/deepseek-v4-flash      5.8s
├── execute_tool TodoWrite call_ueuo1yiw     78µs
├── chat ollama_cloud/deepseek-v4-flash      1.7s
├── execute_tool Bash call_t5hbil7i           5ms
├── chat ollama_cloud/deepseek-v4-flash      2.9s
├── execute_tool TodoWrite call_ct5ppvul     63µs
├── chat ollama_cloud/deepseek-v4-flash      2.0s
├── execute_tool Edit call_e6uvkwzt         266µs
├── chat ollama_cloud/deepseek-v4-flash     11.6s
├── execute_tool TodoWrite call_bmy7wzar     65µs
├── chat ollama_cloud/deepseek-v4-flash      2.1s
├── execute_tool Read call_8skzfefj         179µs
├── chat ollama_cloud/deepseek-v4-flash      4.1s
├── execute_tool Edit call_e2hxmema         649µs
├── chat ollama_cloud/deepseek-v4-flash      2.6s
├── execute_tool TodoWrite call_rwk4cdbc     79µs
├── chat ollama_cloud/deepseek-v4-flash      2.2s
├── chat ollama_cloud/deepseek-v4-flash      4.2s
├── chat ollama_cloud/deepseek-v4-flash      2.6s
├── execute_tool Bash call_lz5embmm          1.1s
├── chat ollama_cloud/deepseek-v4-flash      3.3s
├── execute_tool Bash call_injc3i3m           7ms
├── execute_tool Bash call_73t5n0xb           6ms
├── chat ollama_cloud/deepseek-v4-flash      6.3s
├── execute_tool Bash call_w28s8muw           7ms
├── chat ollama_cloud/deepseek-v4-flash     10.2s
├── execute_tool Bash call_xwphdc4p           6ms
├── execute_tool Bash call_386w4snb           5ms
├── chat ollama_cloud/deepseek-v4-flash      4.4s
├── chat ollama_cloud/deepseek-v4-flash      1.7s
├── execute_tool Read call_ob9iel1d         223µs
├── chat ollama_cloud/deepseek-v4-flash     11.2s
├── execute_tool TodoWrite call_8h7pi8kf     60µs
├── chat ollama_cloud/deepseek-v4-flash      1.8s
├── execute_tool Bash call_fmtjim65           8ms
├── chat ollama_cloud/deepseek-v4-flash      1.6s
├── execute_tool Bash call_cnbmnofz          2.7s
├── chat ollama_cloud/deepseek-v4-flash      1.6s
├── execute_tool Bash call_zi9u38g9         24.9s
├── chat ollama_cloud/deepseek-v4-flash      1.6s
├── execute_tool Bash call_qren75l5          11ms
├── chat ollama_cloud/deepseek-v4-flash      1.9s
├── execute_tool Bash call_m5agn9u1         952ms
├── chat ollama_cloud/deepseek-v4-flash      1.7s
├── execute_tool Bash call_iqb5htwr           5ms
├── chat ollama_cloud/deepseek-v4-flash      2.4s
├── execute_tool TodoWrite call_7x3itckh     71µs
├── chat ollama_cloud/deepseek-v4-flash      2.9s
├── chat ollama_cloud/deepseek-v4-flash      1.7s
├── execute_tool Bash call_02j2d0ys           5ms
├── execute_tool Bash call_qy29kui9           6ms
├── chat ollama_cloud/deepseek-v4-flash      1.8s
├── chat ollama_cloud/deepseek-v4-flash      2.1s
╰── chat ollama_cloud/deepseek-v4-flash      4.5s
Stats
Tool Calls

╭───────────┬───────┬───────┬────────╮
│ Tool      │ Calls │ Fail% │ Avg    │
├───────────┼───────┼───────┼────────┤
│ Bash      │ 18    │ 0%    │ 1651ms │
│ TodoWrite │ 7     │ 0%    │ 0ms    │
│ Read      │ 5     │ 0%    │ 0ms    │
│ Edit      │ 2     │ 0%    │ 0ms    │
╰───────────┴───────┴───────┴────────╯

Token Usage

╭────────────────────────────────┬─────────┬────────┬────────────┬─────────┬──────╮
│ Model                          │ Prompt  │ Cached │ Completion │ Total   │ Cost │
├────────────────────────────────┼─────────┼────────┼────────────┼─────────┼──────┤
│ ollama_cloud/deepseek-v4-flash │ 1736914 │ 0      │ 8808       │ 1745722 │ -    │
╰────────────────────────────────┴─────────┴────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ standard │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

@edenreich
edenreich marked this pull request as ready for review July 30, 2026 23:23
@edenreich
edenreich requested a review from a team as a code owner July 30, 2026 23:23
@edenreich
edenreich merged commit 51d7c3d into main Jul 30, 2026
5 checks passed
@edenreich
edenreich deleted the fix/issue-149 branch July 30, 2026 23:23
inference-gateway-releaser Bot added a commit that referenced this pull request Aug 1, 2026
## [0.8.1](v0.8.0...v0.8.1) (2026-08-01)

### 🐛 Bug Fixes

* disable take_screenshot tool and remove screenshot references from system prompt for lightpanda engine ([#150](#150)) ([51d7c3d](51d7c3d)), closes [#149](#149), references [#5](#5)

### 🔧 Miscellaneous

* **deps:** bump ADL CLI to v0.58.1 ([#151](#151)) ([6b94c67](6b94c67))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error when the agent is trying to take a screenshot but the engine is lightpanda

1 participant